From d46e5d1726314c14aef4eb77981d5e1d4455840a Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Fri, 9 Dec 2022 17:27:58 +0100 Subject: [PATCH] try #1. --- pymodbus/client/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pymodbus/client/base.py b/pymodbus/client/base.py index 866bab57c4..71a35f1339 100644 --- a/pymodbus/client/base.py +++ b/pymodbus/client/base.py @@ -314,11 +314,12 @@ def connection_made(self, transport): async def close(self): # pylint: disable=invalid-overridden-method """Close connection.""" if self.transport: + _logger.debug("--> JAN: closing transport") self.transport.close() + _logger.debug("--> JAN: closed transport") while self.transport is not None: - if self.transport.is_closing(): - _logger.debug("Waiting for transport close.") await asyncio.sleep(0.1) + _logger.debug("--> JAN: done transport") self._connected = False def connection_lost(self, reason): @@ -326,6 +327,7 @@ def connection_lost(self, reason): The argument is either an exception object or None """ + _logger.debug("--> JAN connection_lost called!") self._connection_lost(reason) if self.factory: