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
......@@ -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]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment