Giampaolo Rodola' <g.rod...@gmail.com> added the comment: > 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. ---------- _______________________________________ 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