adamhj <ada...@gmail.com> added the comment:

> A non connected socket must be writable in order to connect.
i can't understand this, does it means that one may use self.connect() in 
handle_write()? and in fact i found something seems opposite on this page: 
http://docs.python.org/howto/sockets.html

"If a socket is in the output readable list, you can be 
as-close-to-certain-as-we-ever-get-in-this-business that a recv on that socket 
will return something. Same idea for the writable list. You’ll be able to send 
something."

"If you have created a new socket to connect to someone else, put it in the 
potential_writers list. If it shows up in the writable list, you have a decent 
chance that it has connected."

from the latter paragraph may i assume that a writable socket should always has 
been connected?

> Not sure what you mean here. Why would you call connect() twice?
sorry for the typo, it should be "if we call dispatcher.send() immediately 
after .connect(), socket error 10057 may be raised", this happens if you 
connect to a high delay remote port, when the .send() is called before the SYN 
ACK is received. 

i think it maybe the programmer's responsibility to check the connection 
availability when using dispatcher class, but at least for dispatcher_with_send 
class, programmer should not need do anything special to use send() after a 
successful connect(), if .send() is called before connection established 
successfully, send() should only buffer the sending data and wait the socket to 
become writable

by the way, i found this behavior on windows 7 x32/python 2.7.2

----------

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

Reply via email to