From fe564e5721bacb94dc58e1af2996546bce646681 Mon Sep 17 00:00:00 2001 From: Marcel Nijenhof Date: Thu, 25 Feb 2021 15:19:57 +0100 Subject: [PATCH] Bug fix: hang/loop in sendrecv --- lmwsip/__init__.py | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lmwsip/__init__.py b/lmwsip/__init__.py index a337d8f..afae126 100644 --- a/lmwsip/__init__.py +++ b/lmwsip/__init__.py @@ -12,7 +12,7 @@ from datetime import datetime, timedelta from dateutil import tz """ Version info changed by git hook """ -__version__ = '0.1.01' +__version__ = '0.1.02' class LmwSip: """Class to connect to the LMW Standard Interface prototcol (sip) @@ -743,6 +743,11 @@ retry on socket failure. ret = "" self.reconnectcheck() while (ret == "") and (c < 3): + if (self._socket == None): + time.sleep(10) + self.log.warning("LmwSip.sendrecv: reconnect") + self.connect() + self.login() try: self.send(cmd) ret = self.recv() diff --git a/setup.py b/setup.py index ac302cc..f81ee33 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ with open("README.md", "r") as fh: setuptools.setup( name="lmwsip", # Replace with your own username - version="0.1.01", + version="0.1.02", author="Marcel Nijenhof", author_email="pip@pion.xs4all.nl", description="Interface for the lmw sip protocol",