fix socket assert

This commit is contained in:
cpwu 2022-07-20 14:30:37 +08:00
parent 1919988413
commit 308e68972d
1 changed files with 4 additions and 0 deletions

View File

@ -183,12 +183,16 @@ class TAdapter:
s.settimeout(3)
try:
res = s.connect_ex((self.remoteIP, taosadapter_port))
s.shutdown(2)
if res == 0:
tdLog.info(f"the taosadapter has been started, using port:{taosadapter_port}")
else:
tdLog.info(f"the taosadapter do not started!!!")
except socket.error as e:
tdLog.notice("socket connect error!")
finally:
if s:
s.close()
# tdLog.debug("the taosadapter has been started.")
time.sleep(1)