ipv6 for ipstatus

This commit is contained in:
macos 2020-06-17 19:17:44 +08:00
parent ddea313536
commit da968a776d
2 changed files with 6 additions and 10 deletions

@ -115,14 +115,12 @@ def tupd():
def ip_status():
ip_check = 0
for i in [CU, CT, CM]:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
try:
s.connect((i, PORBEPORT))
s = socket.create_connection((i, PORBEPORT), timeout=1)
s.close()
del s
except:
ip_check += 1
s.close()
del s
if ip_check >= 2:
return False
else:

@ -99,14 +99,12 @@ def tupd():
def ip_status():
ip_check = 0
for i in [CU, CT, CM]:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(1)
try:
s.connect((i, PORBEPORT))
s = socket.create_connection((i, PORBEPORT), timeout=1)
s.close()
del s
except:
ip_check += 1
s.close()
del s
if ip_check >= 2:
return False
else: