flush dns , every time

This commit is contained in:
cppla 2023-05-31 11:06:28 +08:00
parent 9077f1058a
commit 5cfd533daf
2 changed files with 20 additions and 18 deletions

@ -155,6 +155,8 @@ def _ping_thread(host, mark, port):
lostPacket = 0
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
while True:
# flush dns , every time.
IP = host
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
try:
@ -165,7 +167,6 @@ def _ping_thread(host, mark, port):
except Exception:
pass
while True:
if packet_queue.full():
if packet_queue.get() == 0:
lostPacket -= 1

@ -153,6 +153,8 @@ def _ping_thread(host, mark, port):
lostPacket = 0
packet_queue = Queue(maxsize=PING_PACKET_HISTORY_LEN)
while True:
# flush dns, every time.
IP = host
if host.count(':') < 1: # if not plain ipv6 address, means ipv4 address or hostname
try:
@ -163,7 +165,6 @@ def _ping_thread(host, mark, port):
except Exception:
pass
while True:
if packet_queue.full():
if packet_queue.get() == 0:
lostPacket -= 1