Closed cwe-skov-dk closed 2 months ago
This change makes sense - I'll add it in as soon as I'm done with another change I'm in the middle of.
Thanks for the report!
This is now available as commit dcd1c61 in the "develop" branch.
Note that you will still want to pass in a host and port when making the asyncssh.connect() call. Otherwise, things like the known hosts lookup may fail to find the right entry for the server you are connecting to.
Thanks a lot!
Yes, I know about the hostname and do pass that to asyncssh.connect() in my implementation.
I use asyncssh 2.17.0 to connect a server using an established WebRTC tunnel. To connect the tunnel and asyncssh I create a socket.socketpair() and use one end of the pair inside asyncssh.connect() as sock argument.
This ends in a failure in sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) inside connection_made() in asyncssh connection.py line 1275.
Adding a test for sock.family fixes the issue and the connection is established correctly using the socketpair socket: