Author GeorgeY
Recipients GeorgeY, martin.panter, r.david.murray
Date 2016-10-21.02:07:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Hello David,

   Yes I had the same thought with you that the information of socket is lost at operating syetem level.

   However, I hope at Python level this kind of information will not be lost.

   Once the socket has been created by incoming connection, the address information of 'laddr' and 'raddr' has been known, and print(socket) will show them. It is not necessarily lost when the connection is broken. Any static method, like assigning an attribute of address to the socket will help.

   To the the least, Python shall not automatically destroy the socket object simply because it has been closed by Windows. Otherwise any attempt to record the address information of the socket will fail after it is destoyed.

   The error shown in message 278968 has clearly shown that even as a key, the socket object cannot function because it is already destroyed.

sock_err @ <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>

Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:/Users/user/Desktop/", line 39, in handle_sock_err
    addr_del = sock.getpeername()
OSError: [WinError 10038] 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python34\lib\", line 911, in _bootstrap_inner
  File "C:/Users/user/Desktop/", line 67, in run
  File "C:/Users/user/Desktop/", line 41, in handle_sock_err
    addr_del = socks2addr[sock]
KeyError: <socket.socket [closed] fd=-1, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0>
Date User Action Args
2016-10-21 02:07:31GeorgeYsetrecipients: + GeorgeY, r.david.murray, martin.panter
2016-10-21 02:07:31GeorgeYsetmessageid: <>
2016-10-21 02:07:31GeorgeYlinkissue28447 messages
2016-10-21 02:07:29GeorgeYcreate