You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues and didn't find my feature already requested there
Feature description
I'd like the ability to wrap a stdlib socket in a SocketStream/UNIXSocketStream/SocketListener/UDPSocket/ConnectedUDPSocket
Ideally it would be a synchronous function that takes a connected or listening socket of any kind and does the right thing, but asyncio only provides async methods to adopt a socket. It's also hard to detect if a socket is connected or connecting or listening securely for the purposes of wrapping with TLS
Perhaps the best interface for now would be two async functions, async def wrap_client_sock -> SocketStream | UNIXSocketStream | ConnectedUDPSocket and async def wrap_server_sock -> SocketListener | UDPSocket ?
Use case
I plan to use it with socket.socketpair in the anyio.to_process.run_sync implementation to fix #516
The text was updated successfully, but these errors were encountered:
Things to check first
Feature description
I'd like the ability to wrap a stdlib socket in a SocketStream/UNIXSocketStream/SocketListener/UDPSocket/ConnectedUDPSocket
Ideally it would be a synchronous function that takes a connected or listening socket of any kind and does the right thing, but asyncio only provides async methods to adopt a socket. It's also hard to detect if a socket is connected or connecting or listening securely for the purposes of wrapping with TLS
Perhaps the best interface for now would be two async functions,
async def wrap_client_sock -> SocketStream | UNIXSocketStream | ConnectedUDPSocket
andasync def wrap_server_sock -> SocketListener | UDPSocket
?Use case
I plan to use it with socket.socketpair in the anyio.to_process.run_sync implementation to fix #516
The text was updated successfully, but these errors were encountered: