[issue6550] asyncore incorrect failure when connection is refused and using async_chat channel

Nir Soffer report at bugs.python.org
Mon Aug 3 14:19:55 CEST 2009


Nir Soffer <nirsof at gmail.com> added the comment:

handle_expt is documented to be called when there is OOB data. However,
handle_expt_event is not documented, and according the framework design
as I see it, it simply means "socket has exceptional condition" when
select returns. On unix, this means there is oob data, and on Windows,
it means "there is some error".

This works exactly the same for handle_read_event and handle_write_event
- they may be called on connection refused error. Checking for errors in
handle_expt_event is the right thing to do, and allow you to avoid the
ugly checks and double try..except in _exception.

If you want handle_foo_event to be called only on foo events, then they
will not have anything to do except calling handle_foo. This is actually
the case now in handle_expt_event. I don't see any advantage of this
design change.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6550>
_______________________________________


More information about the Python-bugs-list mailing list