Commit d5e99000 authored by Alan Marchiori's avatar Alan Marchiori

added retry logic on socket connection

parent 9914f316
......@@ -189,11 +189,15 @@ def main():
#shutdown connection
skt = None
# reopen socket
skt = pakbus.open_socket(host, port, timeout)
# reopen socket
while skt == None:
skt = pakbus.open_socket(host, port, timeout)
if skt == None:
self.log.error("Failed to reopen socket, retry")
except socket.error as msg:
logging.error("Socket died with: {}".format(msg))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment