Christian Heimes <li...@cheimes.de> added the comment: The problem is fixed and your example behaves as expected.
The laddr string is the result of inside.getsockname() and raddr string is the result of inside.getpeername(). In your example, inside and client share the same file descriptor. When the function exits client goes out of scope, the reference count of client drops to 0, the object gets deallocated and Python closes the shared file descriptor. In outside, the shared fd is gone and outside.getsockname() and outside.getpeername() fail. Basically the outside socket is dead because its fd has been closed. You have to duplicate the fd or detach the socket to keep the fd open. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue28134> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com