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.
Created on 2011年11月02日 16:55 by xdegaye, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| dispatcher_addr.py | xdegaye, 2011年11月02日 16:55 | |||
| dispatcher_addr.diff | xdegaye, 2011年11月02日 16:56 | review | ||
| Messages (2) | |||
|---|---|---|---|
| msg146849 - (view) | Author: Xavier de Gaye (xdegaye) * (Python triager) | Date: 2011年11月02日 16:55 | |
When an asyncore dispatcher initiates a tcp connection, its representation lacks the peer address. The output of the attached script 'dispatcher_addr.py' gives on linux with Python 3.2: call stack in handle_connect_event: <module>->main->loop->poll->write->handle_write_event->handle_connect_event self.addr after connection: None The attached patch fixes the problem. The patch includes a test case. The following comment in the patch: # EWOULDBLOCK may also be returned by winsock when calling connect # while the connection attempt is in progress refers to the following statement in http://msdn.microsoft.com/en-us/library/aa923167.aspx """ As a result, it is not recommended that applications use multiple calls to connect to detect connection completion. If they do, they must be prepared to handle WSAEINVAL and WSAEWOULDBLOCK error codes the same way that they handle WSAEALREADY to ensure robust execution. """ Note that two consecutive calls to socket.getsockopt(socket.SOL_SOCKET, socket.SO_ERROR) are made when handle_write_event() is called and self.connected is False: one in handle_write_event and the following right away in handle_connect_event. This seems useless. |
|||
| msg156563 - (view) | Author: Giampaolo Rodola' (giampaolo.rodola) * (Python committer) | Date: 2012年03月22日 14:25 | |
Closing as duplicate of issue 13694. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:23 | admin | set | github: 57534 |
| 2012年03月22日 14:25:29 | giampaolo.rodola | set | status: open -> closed resolution: duplicate messages: + msg156563 versions: + Python 2.7 |
| 2011年11月03日 01:58:41 | pitrou | set | nosy:
+ josiahcarlson, giampaolo.rodola, stutzbach stage: patch review versions: + Python 3.3 |
| 2011年11月02日 16:56:16 | xdegaye | set | files:
+ dispatcher_addr.diff keywords: + patch |
| 2011年11月02日 16:55:39 | xdegaye | set | files: + dispatcher_addr.py |
| 2011年11月02日 16:55:01 | xdegaye | create | |