Commit 7219255e authored by Michael König's avatar Michael König

fixed "Retry to connect to server"

parent 853f5264
...@@ -44,17 +44,16 @@ class SocketInput(InputBase): ...@@ -44,17 +44,16 @@ class SocketInput(InputBase):
else: else:
print("Socket created.") print("Socket created.")
try: while True:
self.socket.connect((str(self.logServerIp), self.logServerPort)) try:
print("Successfully connected to " + self.dst + "") self.socket.connect((str(self.logServerIp), self.logServerPort))
except socket.error: print("Successfully connected to " + self.dst + "")
print("\ return
Error: Could not connect to " + self.dst + "\ except socket.error:
Retrying in " + str(LOGSERVER_CONNECT_RETRY_TIME) + "s ...\ print("Error: Could not connect to " + self.dst + ". Retrying in " + str(LOGSERVER_CONNECT_RETRY_TIME) + "s ...")
") time.sleep(LOGSERVER_CONNECT_RETRY_TIME)
time.sleep(LOGSERVER_CONNECT_RETRY_TIME) else:
else: pass
pass
def tearDown(self): def tearDown(self):
self.socket.close() self.socket.close()
......
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