ping
This commit is contained in:
parent
60426cd155
commit
50dfc5188f
1 changed files with 2 additions and 2 deletions
|
@ -38,8 +38,8 @@ def pinger(nick, connection):
|
||||||
if (time.time() - property_list[nick]["last_ping"]) > 60 and not property_list[nick]["ping_pending"]:
|
if (time.time() - property_list[nick]["last_ping"]) > 60 and not property_list[nick]["ping_pending"]:
|
||||||
print("Sent ping message to " + nick)
|
print("Sent ping message to " + nick)
|
||||||
connection.sendall(bytes(f"PING {server}\r\n","UTF-8"))
|
connection.sendall(bytes(f"PING {server}\r\n","UTF-8"))
|
||||||
ping_pending = True
|
property_list[nick]["ping_pending"] = True
|
||||||
elif ping_pending and ((time.time() - property_list[nick]["last_ping"]) > 120):
|
elif property_list[nick]["ping_pending"] and ((time.time() - property_list[nick]["last_ping"]) > 120):
|
||||||
property_list[nick]["cause"] = "Ping timeout: 120 seconds"
|
property_list[nick]["cause"] = "Ping timeout: 120 seconds"
|
||||||
connection.close()
|
connection.close()
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in a new issue