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("error:"+str(err)) print(sock.getpeername()) mailbox.put( (("sock_err",sock), 'Server') ) continue server_sock.close() ======================== I also get the same type of error: ------------------------ Traceback (most recent call last): File "C:\Users\user\Desktop\SelectWinServer.py", line 112, in <module> data = sock.recv(BUFSIZ) ConnectionResetError: [WinError 10054] connection forcibly close During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Users\user\Desktop\SelectWinServer.py", line 123, in <module> print(sock.getpeername()) OSError: [WinError 10038] not a socket ======================== ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28447> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com