mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-10 07:21:01 -04:00
Implemented link timeouts and keepalive
This commit is contained in:
parent
98a489ee11
commit
260f8bbaf1
4 changed files with 153 additions and 24 deletions
|
@ -97,6 +97,13 @@ class Transport:
|
|||
Transport.jobs_locked = False
|
||||
return sent
|
||||
|
||||
@staticmethod
|
||||
def packet_filter(packet):
|
||||
if packet.context == RNS.Packet.KEEPALIVE:
|
||||
return True
|
||||
if not packet.packet_hash in Transport.packet_hashlist:
|
||||
return True
|
||||
|
||||
@staticmethod
|
||||
def inbound(raw, interface=None):
|
||||
while (Transport.jobs_running):
|
||||
|
@ -111,7 +118,7 @@ class Transport:
|
|||
|
||||
RNS.log(str(interface)+" received packet with hash "+RNS.prettyhexrep(packet.packet_hash), RNS.LOG_DEBUG)
|
||||
|
||||
if not packet.packet_hash in Transport.packet_hashlist:
|
||||
if Transport.packet_filter(packet):
|
||||
Transport.packet_hashlist.append(packet.packet_hash)
|
||||
|
||||
if packet.packet_type == RNS.Packet.ANNOUNCE:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue