Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > asyncore/asynchat do not notify connection errors on Wintel?

Reply
Thread Tools

asyncore/asynchat do not notify connection errors on Wintel?

 
 
Z. Kotzer
Guest
Posts: n/a
 
      03-15-2006
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!


 
Reply With Quote
 
 
 
Reply

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 On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Received non-routine Notify message: Invalid ID info f.pusch@klopotek.de Cisco 2 08-22-2005 09:35 AM
VPN log - Received Unexpected InitialContact Notify (PLMgrNotify:886) reo Cisco 0 04-20-2005 09:46 AM
Errors, errors, errors Mark Goldin ASP .Net 2 01-17-2004 08:05 PM
Using custom TypeEditor does not notify parent property Rob Mayo ASP .Net Building Controls 0 07-17-2003 05:22 PM
Using custom TypeEditor does not notify parent property Rob Mayo ASP .Net Web Controls 0 07-17-2003 05:22 PM



Advertisments