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
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -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,6 +79,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 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)