materials icon indicating copy to clipboard operation
materials copied to clipboard

Multiconnection server can't handle Connection Reset events

Open sscaglia opened this issue 3 years ago • 0 comments

It seems the Muli-connection server example doesn't properly handle the Connection Reset Error;

Traceback (most recent call last):
  File "server.py", line 65, in <module>
    service_connection(key, mask)
  File "server.py", line 24, in service_connection
    recv_data = sock.recv(1024)  # Should be ready to read
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host

This error occurs when, for example, the Windows Command Prompt running the client.py (connected to the server) is closed. In this case, a peer reset is sent to the server, but since the server can't handle it, it simply exits with the above error.

Is there any specific event to catch this error and avoid breaking the server?

Thanks SS

sscaglia avatar Jun 27 '21 16:06 sscaglia