[Python-bugs-list] [ python-Bugs-528295 ] asyncore unhandled write event

noreply@sourceforge.net noreply@sourceforge.net
Thu, 14 Mar 2002 18:52:20 -0800


Bugs item #528295, was opened at 2002-03-10 19:34
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=528295&group_id=5470

Category: Python Library
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Carl J. Nobile (cnobile)
Assigned to: Nobody/Anonymous (nobody)
Summary: asyncore unhandled write event

Initial Comment:
I'm getting an unhandled write event on a handle_accept
callback in asyncore.dispatch. This worked fine in
python-2.1.1, but now seems to be broken in python-2.2.

This happens when I send a SIGHUP to reread my config
file. The signal lets me break out of the
asyncore.loop() to reread the configuration and restart
the server. The self.accept() method returns a TypeNone
instead of the expected tuple when it is called in
handle_accept.

I've written a database key server which is a fairly
large package and is dependent on a few other packages,
so sending the code would not be too easy. If I can
duplicate the problem in a few lines of code I will
send it along at a later date.

Thanks for your attention.

Carl

----------------------------------------------------------------------

>Comment By: Carl J. Nobile (cnobile)
Date: 2002-03-14 21:52

Message:
Logged In: YES 
user_id=482117

My question then is why didn't it do this when I ran my app
with python 2.1.1. Something has changed in 2.2 and I don't
think it was asyncore, I do know some work was done to the
low level socket and select modules so they could handle
IPV6. I understand why the None is being returned, but an
accept shouldn't even be called on a write event coming from
a select or poll.

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2002-03-14 18:24

Message:
Logged In: YES 
user_id=11375

Looking at the implementation of accept() in asyncore.py, it will 
return 
None when the socket is in non-blocking mode and the accept() would block.  
There's really nothing else accept() could
return in this case, so you'll 
probably have to write your code to 
handle this case.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=528295&group_id=5470