Message221741
| Author |
François-Xavier.Bourlet |
| Recipients |
BreamoreBoy, François-Xavier.Bourlet, giampaolo.rodola, josiahcarlson, neologix, stutzbach, vstinner, xdegaye |
| Date |
2014年06月27日.21:30:57 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<CAG9r-DaNwEh6Y0-=BJSK6FUdfqfq3CSyqLSefkOH9sHVmR_Wkw@mail.gmail.com> |
| In-reply-to |
<1403904491.39.0.362178134346.issue12498@psf.upfronthosting.co.za> |
| Content |
No worries, I am glad to see asyncore going away. It was indeed badly
designed in the first place.
--
François-Xavier Bourlet
On Fri, Jun 27, 2014 at 2:28 PM, STINNER Victor <report@bugs.python.org> wrote:
>
> STINNER Victor added the comment:
>
> "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.
>
> ----------
> nosy: +haypo
> resolution: -> wont fix
> status: open -> closed
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue12498>
> _______________________________________ |
|