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.

Author yselivanov
Recipients Ben.Darnell, asvetlov, gvanrossum, pitrou, vstinner, yselivanov
Date 2017-11-16.17:09:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510852167.37.0.213398074469.issue32038@psf.upfronthosting.co.za>
In-reply-to
Content
> Perhaps you can just dup() the socket? That's what the ref counter is for IIRC.

I already dup them for loop.create_server(sock=sock) and loop.create_connection(sock=sock) cases.  Duping for sock_recv & friends will add too much overhead (they are relatively short operations).  Another argument against duping is that the number of open FDs is a limited OS resource.

So far Victor's idea of using '_io_refs' sounds like a perfect fit for both asyncio and uvloop.  After all, asyncio use case is very similar to `socket.makefile()` -- keep the socket object alive while another API relies on it.
History
Date User Action Args
2017-11-16 17:09:27yselivanovsetrecipients: + yselivanov, gvanrossum, pitrou, vstinner, asvetlov, Ben.Darnell
2017-11-16 17:09:27yselivanovsetmessageid: <1510852167.37.0.213398074469.issue32038@psf.upfronthosting.co.za>
2017-11-16 17:09:27yselivanovlinkissue32038 messages
2017-11-16 17:09:27yselivanovcreate