mirror of https://github.com/cppla/ServerStatus
ipv6 for ipstatus
parent
ddea313536
commit
da968a776d
|
@ -115,14 +115,12 @@ def tupd():
|
||||||
def ip_status():
|
def ip_status():
|
||||||
ip_check = 0
|
ip_check = 0
|
||||||
for i in [CU, CT, CM]:
|
for i in [CU, CT, CM]:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
s.settimeout(1)
|
|
||||||
try:
|
try:
|
||||||
s.connect((i, PORBEPORT))
|
s = socket.create_connection((i, PORBEPORT), timeout=1)
|
||||||
|
s.close()
|
||||||
|
del s
|
||||||
except:
|
except:
|
||||||
ip_check += 1
|
ip_check += 1
|
||||||
s.close()
|
|
||||||
del s
|
|
||||||
if ip_check >= 2:
|
if ip_check >= 2:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -99,14 +99,12 @@ def tupd():
|
||||||
def ip_status():
|
def ip_status():
|
||||||
ip_check = 0
|
ip_check = 0
|
||||||
for i in [CU, CT, CM]:
|
for i in [CU, CT, CM]:
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
||||||
s.settimeout(1)
|
|
||||||
try:
|
try:
|
||||||
s.connect((i, PORBEPORT))
|
s = socket.create_connection((i, PORBEPORT), timeout=1)
|
||||||
|
s.close()
|
||||||
|
del s
|
||||||
except:
|
except:
|
||||||
ip_check += 1
|
ip_check += 1
|
||||||
s.close()
|
|
||||||
del s
|
|
||||||
if ip_check >= 2:
|
if ip_check >= 2:
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue