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 giampaolo.rodola
Recipients adamhj, giampaolo.rodola
Date 2012-02-04.13:00:01
SpamBayes Score 2.6164007e-06
Marked as misclassified No
Message-id <1328360402.05.0.72883378817.issue13928@psf.upfronthosting.co.za>
In-reply-to
Content
> i can't understand this, does it means that one may use 
> self.connect() in handle_write()? 

Nope. When handle_write() is called you are supposed to be *already* connected, hence there's no point in calling connect() again. 
This is clear if you look at handle_write_event method or read asyncore doc.



> "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?

Nope. It means that *before* showing up the socket was *not* connected.


> if we call dispatcher.send() immediately after .connect(), 
> socket error 10057 may be raised",

Of course it does: you're not connected yet (10057 = WSAENOTCONN). 
You're supposed to use send() in handle_connect(), when the connection has already been established.
This:

     self.connect()
     self.send('hello')

...is not asyncore is supposed to be used.
History
Date User Action Args
2012-02-04 13:00:02giampaolo.rodolasetrecipients: + giampaolo.rodola, adamhj
2012-02-04 13:00:02giampaolo.rodolasetmessageid: <1328360402.05.0.72883378817.issue13928@psf.upfronthosting.co.za>
2012-02-04 13:00:01giampaolo.rodolalinkissue13928 messages
2012-02-04 13:00:01giampaolo.rodolacreate