diff --git a/py27/bacpypes/tcp.py b/py27/bacpypes/tcp.py index 304bdb07..262155a3 100644 --- a/py27/bacpypes/tcp.py +++ b/py27/bacpypes/tcp.py @@ -692,6 +692,12 @@ def handle_close(self): if self.flush_task: self.flush_task.suspend_task() + # if there is an idle timeout, cancel it + if self.idle_timeout_task: + if _debug: TCPServerActor._debug(" - canceling idle timeout") + self.idle_timeout_task.suspend_task() + self.idle_timeout_task = None + # tell the director this is gone self.director.del_actor(self) diff --git a/py34/bacpypes/tcp.py b/py34/bacpypes/tcp.py index 04ba977a..f4c1560d 100755 --- a/py34/bacpypes/tcp.py +++ b/py34/bacpypes/tcp.py @@ -692,6 +692,12 @@ def handle_close(self): if self.flush_task: self.flush_task.suspend_task() + # if there is an idle timeout, cancel it + if self.idle_timeout_task: + if _debug: TCPServerActor._debug(" - canceling idle timeout") + self.idle_timeout_task.suspend_task() + self.idle_timeout_task = None + # tell the director this is gone self.director.del_actor(self)