Loading sjrpc/server/simple.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -64,10 +64,12 @@ class SimpleRpcServer(ConnectionManager): try: try: connection.receive() connection.receive() except socket.error as err: except socket.error as err: logging.error('Socket error while receiving from client ' 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] except Exception as err: except Exception as err: logging.error('Unknown error while receiving from client' logging.error('Unknown error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] Loading @@ -77,15 +79,18 @@ class SimpleRpcServer(ConnectionManager): try: try: connection.send() connection.send() except socket.error as err: except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] except Exception as err: except Exception as err: logging.error('Unknown error while sending to the client' logging.error('Unknown error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] if event & select.EPOLLHUP: if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] Loading Loading
sjrpc/server/simple.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -64,10 +64,12 @@ class SimpleRpcServer(ConnectionManager): try: try: connection.receive() connection.receive() except socket.error as err: except socket.error as err: logging.error('Socket error while receiving from client ' 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] except Exception as err: except Exception as err: logging.error('Unknown error while receiving from client' logging.error('Unknown error while receiving from client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] Loading @@ -77,15 +79,18 @@ class SimpleRpcServer(ConnectionManager): try: try: connection.send() connection.send() except socket.error as err: except socket.error as err: logging.error('Socket error while sending to the client ' 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] except Exception as err: except Exception as err: logging.error('Unknown error while sending to the client' logging.error('Unknown error while sending to the client ' 'fd/%s: %s' % (fd, err)) 'fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] if event & select.EPOLLHUP: if event & select.EPOLLHUP: logging.error('Socket HUP fd/%s: %s' % (fd, err)) connection.shutdown(self._on_disconnect) connection.shutdown(self._on_disconnect) del self._clients[fd] del self._clients[fd] Loading