This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author adamhj
Recipients adamhj, giampaolo.rodola
Date 2012-02-04.11:21:40
SpamBayes Score 7.312224e-09
Marked as misclassified No
Message-id <1328354502.13.0.51443470703.issue13928@psf.upfronthosting.co.za>
In-reply-to
Content
> 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
History
Date User Action Args
2012-02-04 11:21:42adamhjsetrecipients: + adamhj, giampaolo.rodola
2012-02-04 11:21:42adamhjsetmessageid: <1328354502.13.0.51443470703.issue13928@psf.upfronthosting.co.za>
2012-02-04 11:21:41adamhjlinkissue13928 messages
2012-02-04 11:21:40adamhjcreate