diff --git a/src/judas_client/connector.py b/src/judas_client/connector.py index a68b64a..41d167b 100644 --- a/src/judas_client/connector.py +++ b/src/judas_client/connector.py @@ -174,8 +174,17 @@ class Connector: ) try: message: Message = Message.from_bytes(message_bytes) - # handle incoming ACKs if ( + message.category == Category.CONTROL + and message.action == ControlAction.CLOSE + ): + self.logger.warning( + "[!] Received CLOSE command from server, shutting down." + ) + self.running = False + break + # handle incoming ACKs + elif ( message.category == Category.CONTROL and message.action == ControlAction.ACK ):