mirror of
https://github.com//cppla/ServerStatus
synced 2026-03-26 00:09:49 +08:00
flush dns , every time
This commit is contained in:
@@ -155,6 +155,8 @@ def _ping_thread(host, mark, port):
|
|||||||
lostPacket = 0
|
lostPacket = 0
|
||||||
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
# flush dns , every time.
|
||||||
IP = host
|
IP = host
|
||||||
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
||||||
try:
|
try:
|
||||||
@@ -165,7 +167,6 @@ def _ping_thread(host, mark, port):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
while True:
|
|
||||||
if packet_queue.full():
|
if packet_queue.full():
|
||||||
if packet_queue.get() == 0:
|
if packet_queue.get() == 0:
|
||||||
lostPacket -= 1
|
lostPacket -= 1
|
||||||
|
|||||||
@@ -153,6 +153,8 @@ def _ping_thread(host, mark, port):
|
|||||||
lostPacket = 0
|
lostPacket = 0
|
||||||
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
# flush dns, every time.
|
||||||
IP = host
|
IP = host
|
||||||
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
|
||||||
try:
|
try:
|
||||||
@@ -163,7 +165,6 @@ def _ping_thread(host, mark, port):
|
|||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
while True:
|
|
||||||
if packet_queue.full():
|
if packet_queue.full():
|
||||||
if packet_queue.get() == 0:
|
if packet_queue.get() == 0:
|
||||||
lostPacket -= 1
|
lostPacket -= 1
|
||||||
|
|||||||
Reference in New Issue
Block a user