Skip to content
Snippets Groups Projects
Commit 3e96452f authored by Antoine Millet's avatar Antoine Millet
Browse files

Unknown errors while receiving/sending to a client are now properly handled.

parent e30cc46b
No related branches found
No related tags found
No related merge requests found
......@@ -66,6 +66,11 @@ class SimpleRpcServer(ConnectionManager):
except socket.error as err:
connection.shutdown(self._on_disconnect)
del self._clients[fd]
except Exception as err:
logging.error('Unknown error while receiving from client'
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
if event & select.EPOLLOUT:
# Data are ready to be written on socket
......@@ -74,7 +79,12 @@ class SimpleRpcServer(ConnectionManager):
except socket.error as err:
connection.shutdown(self._on_disconnect)
del self._clients[fd]
except Exception as err:
logging.error('Unknown error while sending to the client'
'fd/%s: %s' % (fd, err))
connection.shutdown(self._on_disconnect)
del self._clients[fd]
if event & select.EPOLLHUP:
connection.shutdown(self._on_disconnect)
del self._clients[fd]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment