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 <1477015651.06.0.8344476997.issue28447@psf.upfronthosting.co.za>
In-reply-to
Content
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/SelectWinServer.py", 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\threading.py", line 911, in _bootstrap_inner
    self.run()
  File "C:/Users/user/Desktop/SelectWinServer.py", line 67, in run
    handle_sock_err(msg[1])
  File "C:/Users/user/Desktop/SelectWinServer.py", 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>
=================
History
Date User Action Args
2016-10-21 02:07:31GeorgeYsetrecipients: + GeorgeY, r.david.murray, martin.panter
2016-10-21 02:07:31GeorgeYsetmessageid: <1477015651.06.0.8344476997.issue28447@psf.upfronthosting.co.za>
2016-10-21 02:07:31GeorgeYlinkissue28447 messages
2016-10-21 02:07:29GeorgeYcreate