Message221739
"Actually the class asyncore.dispatcher_with_send do not handle properly disconnection. When the endpoint shutdown his sending part of the socket, but keep the socket open in reading, the current implementation of dispatcher_with_send will close the socket without sending pending data."
It looks like asyncore doesn't handle this use case.
To me, it doesn't look like a minor issue, but more a design issue. Fixing it requires to change the design of asyncore.
The asyncio module has a better design. It has a write_eof() method to close the write end without touching the read end. For example, for sockets, write_eof() calls sock.shutdown(socket.SHUT_WR). After write_eof(), the read continues in background as any other task. For the read end, the protocol has a eof_received() method to decide if the socket should close, or if it should be kept open for writing (but only for writing).
Giampaolo wrote:
> I think this thread is becoming a little messy and since asyncore/asynchat are in a situation where even the slightest change can break existent code I recommend to be really careful.
Moreover, the asyncore module has been deprecated in favor of the asyncio module.
I close this issue for all these reasons.
Sorry Xavier for your patches, but it's time to focus our efforts on a single module and asyncio has a much better design to handle such use cases. |
|
Date |
User |
Action |
Args |
2014-06-27 21:28:11 | vstinner | set | recipients:
+ vstinner, josiahcarlson, giampaolo.rodola, stutzbach, neologix, BreamoreBoy, xdegaye, François-Xavier.Bourlet |
2014-06-27 21:28:11 | vstinner | set | messageid: <1403904491.39.0.362178134346.issue12498@psf.upfronthosting.co.za> |
2014-06-27 21:28:11 | vstinner | link | issue12498 messages |
2014-06-27 21:28:11 | vstinner | create | |
|