Guido van Rossum added the comment:

Maybe I should explain the need for SELECT_CONNECT more.  This is necessary so 
that on Windows the PollSelector can use WSAPoll().  The reason is that for 
async connect() calls, WSAPoll() doesn't return the FD as writable, just as 
having an exception.  I didn't write the code (Richard Oudkerk did), and I've 
never run it (no access to Windows), but the workaround for the problem with 
WSAPoll() is apparently quite complex:
http://code.google.com/p/tulip/source/browse/tulip/unix_events.py#236

The long and short of it is that portable code must use add_connector() and 
remove_connector() instead of add_writer() and remove_writer() for async 
connect() calls.  So these need to be mapped to something different in the 
selector world.  The right thing would seem to add a separate flag, 
SELECT_CONNECT, with a value distinct from SELECT_IN and SELECT_OUT.  But I 
didn't write the code for that -- I made a hackish change so that the selector 
code exports SELECT_CONNECT as an alias for SELECT_OUT.  I did write code for 
add_connector() and remove_connector() but these may have to be modified 
slightly again later once the selector code has SELECT_OUT != SELECT_CONNECT.

Please do try to understand this -- it would not be possible to support 
WSAPoll() at all without distinguishing between write and connect readyness.

Feel free to ping Richard Oudkerk (shibturn at gmail.com) for more information.

I don't *think* the problems are in my code, since both tests pass when the 
SelectSelector is used.

I can currently only test on OSX 10.7 (Mountain Lion); hopefully I have more 
platforms after tomorrow (my first day at the new job).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16853>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to