Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old March 16th, 2006, 08:55 AM
Z. Kotzer
Guest
 
Posts: n/a
Default asyncore/asynchat do not notify connection errors on Wintel?

I can not get error notifications when an asynchat based client tries to
connect to a non-responsive address.

To validate the problem I changed lib/test/test_asynchat.py as follows:


class echo_client(asynchat.async_chat):
def __init__(self):
asynchat.async_chat.__init__(self)
self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
self.connect(('10.135.0.2', PORT)) # <<<<<<<< Instead of HOST - set
an address that does not listen to this port
self.set_terminator("\n")
self.buffer = ""

# <<<<<<<<<<<<<<< And added an error handler
def handle_error(self):
print 'ERROR'


Running it prints nothing - handle_error is not called and nothing is raised
from asyncore.loop().

Debugging it shows that asyncore.connect gets EWOULDBLOCK and returns
normally (as may be expected), select in asyncore.poll returns nothing
(including empty e) and the socket remains forever.

Anybody has an experience with this behaviour?

Thanks in advance!


 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles