From cced04d5be6552d4b77840bf4ea313826b14acc8 Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Thu, 27 Apr 2017 11:34:42 -0400 Subject: [PATCH] check for no more clients for del_actor, not every indication --- samples/TCPClient.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/TCPClient.py b/samples/TCPClient.py index 83b5e5bf..b54c4c07 100644 --- a/samples/TCPClient.py +++ b/samples/TCPClient.py @@ -88,16 +88,16 @@ def indication(self, add_actor=None, del_actor=None, actor_error=None, error=Non if del_actor: if _debug: MiddleManASE._debug("indication del_actor=%r", del_actor) + # if there are no clients, quit + if not self.elementService.clients: + if _debug: MiddleManASE._debug(" - no clients, stopping") + stop() + if actor_error: if _debug: MiddleManASE._debug("indication actor_error=%r error=%r", actor_error, error) # tell the director to close self.elementService.disconnect(actor_error.peer) - # if there are no clients, quit - if not self.elementService.clients: - if _debug: MiddleManASE._debug(" - no clients, stopping") - stop() - bacpypes_debugging(MiddleManASE) #