Bug fix: hang/loop in sendrecv
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Marcel Nijenhof
2021-02-25 15:19:57 +01:00
parent 2b2aaa7336
commit fe564e5721
2 changed files with 7 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ from datetime import datetime, timedelta
from dateutil import tz from dateutil import tz
""" Version info changed by git hook """ """ Version info changed by git hook """
__version__ = '0.1.01' __version__ = '0.1.02'
class LmwSip: class LmwSip:
"""Class to connect to the LMW Standard Interface prototcol (sip) """Class to connect to the LMW Standard Interface prototcol (sip)
@@ -743,6 +743,11 @@ retry on socket failure.
ret = "" ret = ""
self.reconnectcheck() self.reconnectcheck()
while (ret == "") and (c < 3): while (ret == "") and (c < 3):
if (self._socket == None):
time.sleep(10)
self.log.warning("LmwSip.sendrecv: reconnect")
self.connect()
self.login()
try: try:
self.send(cmd) self.send(cmd)
ret = self.recv() ret = self.recv()

View File

@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
setuptools.setup( setuptools.setup(
name="lmwsip", # Replace with your own username name="lmwsip", # Replace with your own username
version="0.1.01", version="0.1.02",
author="Marcel Nijenhof", author="Marcel Nijenhof",
author_email="pip@pion.xs4all.nl", author_email="pip@pion.xs4all.nl",
description="Interface for the lmw sip protocol", description="Interface for the lmw sip protocol",