[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-24 Thread Georgey
Georgey added the comment: Not only does the getpeername() method not work, but the socket instance itself has been destroyed as garbage by python. - I understand the former, but cannot accept the latter. -- resolution: not a bug -> wont fix status: closed -> p

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-20 Thread Georgey
Georgey added the comment: 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

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-19 Thread Georgey
Georgey added the comment: The socket close accident is not caused by queue or calling handle_sock_error at all, it happened right after select error After changing the Exception handling of main Thread: except Exception as err: print("

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-19 Thread Georgey
Georgey added the comment: I have changed the code to report any error that occurs in receiving message, and it reports: [WinError10054] An existing connection was forcibly closed by the remote host Well, this error is the one we need to handle, right? A server need to deal with abrupt

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-19 Thread Georgey
Georgey added the comment: so when do you think the error socket closes? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28447> ___ __

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-19 Thread Georgey
Georgey added the comment: As your request, I simplify the server here: -- import socket import select, time import queue, threading ISOTIMEFORMAT = '%Y-%m-%d %X' BUFSIZ = 2048 TIMEOUT = 10 ADDR = ('', 15625) SEG = "ā—Žā—Ž" SEG_ =

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-16 Thread Georgey
Georgey added the comment: Yes that is definitely a closed socket. But it is strange that in a single thread server without select module, the socket is never closed until I explicitly use close() method. except: print(sock) #<- here it looks normal time.sleep(3) pr

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Georgey
Georgey added the comment: "Without code or something demonstrating the bug, Iā€™m pretty sure it is a bug in your program" Here is the main Thread --- mailbox = queue.Queue() while True: #print(addr_groups) unknown_clients=[] for key in yellow

[issue28447] socket.getpeername() failure on broken TCP/IP connection

2016-10-14 Thread Georgey
Georgey added the comment: I have changed my Username, thanks martin. " But it sounds like you may be closing the socket in one thread, and trying to use it in another thread" -- I do not attempt to "close" it in main thread. Main only detect the connection failure a