Message188248
recv() returning an empty string has always been an alias for "connection lost" though, that is why it cannot be used and I was proposing returning a new type in Python 3.4.
Point is we're paying a bad design decision: asyncore shouldn't have asked the user to call recv() directly in the first place and call a data_received(chunk) callback method instead.
Deciding what's best to do at this point without breaking existent code is not easy, that is why I think that on python <= 3.3 we should fix *asynchat* in order to take EAGAIN/EWOULDBLOCK into account and leave asyncore's recv() alone.
The issue would still exist but it would be mitigated by the fact that who wants to write a protocol is likely to use asynchat, not asyncore.
As for Python 3.4 we can:
- make asyncore's recv() return None and document it
- deprecate recv()
- introduce data_received(chunk) |
|
Date |
User |
Action |
Args |
2013-05-02 00:30:50 | giampaolo.rodola | set | recipients:
+ giampaolo.rodola, josiahcarlson, stutzbach, python-dev, Nidan |
2013-05-02 00:30:50 | giampaolo.rodola | set | messageid: <1367454650.7.0.0218231669038.issue16133@psf.upfronthosting.co.za> |
2013-05-02 00:30:50 | giampaolo.rodola | link | issue16133 messages |
2013-05-02 00:30:49 | giampaolo.rodola | create | |
|