Yury Selivanov <yseliva...@gmail.com> added the comment:

> 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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32038>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to