diff --git a/rpyc/core/protocol.py b/rpyc/core/protocol.py index ad751c10..ccc4c2be 100644 --- a/rpyc/core/protocol.py +++ b/rpyc/core/protocol.py @@ -409,7 +409,7 @@ def serve_all(self): """Serves all requests and replies for as long as the connection is alive.""" try: - while True: + while not self.closed: self.serve(None) except (socket.error, select_error, IOError): if not self.closed: