mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 23:40:18 +00:00
Transport optimisations
This commit is contained in:
parent
d334613888
commit
0a8b755230
@ -545,13 +545,12 @@ class Transport:
|
|||||||
@staticmethod
|
@staticmethod
|
||||||
def outbound(packet):
|
def outbound(packet):
|
||||||
while (Transport.jobs_running):
|
while (Transport.jobs_running):
|
||||||
# TODO: Profile actual impact here on faster links
|
sleep(0.0005)
|
||||||
sleep(0.01)
|
|
||||||
|
|
||||||
Transport.jobs_locked = True
|
Transport.jobs_locked = True
|
||||||
|
|
||||||
# TODO: This updateHash call might be redundant
|
# TODO: This updateHash call might be redundant
|
||||||
packet.update_hash()
|
# packet.update_hash()
|
||||||
|
|
||||||
sent = False
|
sent = False
|
||||||
outbound_time = time.time()
|
outbound_time = time.time()
|
||||||
@ -735,13 +734,14 @@ class Transport:
|
|||||||
Transport.packet_hashlist.append(packet.packet_hash)
|
Transport.packet_hashlist.append(packet.packet_hash)
|
||||||
stored_hash = True
|
stored_hash = True
|
||||||
|
|
||||||
def send_packet():
|
# TODO: Re-evaluate potential for blocking
|
||||||
|
# def send_packet():
|
||||||
|
# Transport.transmit(interface, packet.raw)
|
||||||
|
# thread = threading.Thread(target=send_packet)
|
||||||
|
# thread.daemon = True
|
||||||
|
# thread.start()
|
||||||
|
|
||||||
Transport.transmit(interface, packet.raw)
|
Transport.transmit(interface, packet.raw)
|
||||||
|
|
||||||
thread = threading.Thread(target=send_packet)
|
|
||||||
thread.daemon = True
|
|
||||||
thread.start()
|
|
||||||
|
|
||||||
sent = True
|
sent = True
|
||||||
|
|
||||||
if sent:
|
if sent:
|
||||||
@ -860,7 +860,7 @@ class Transport:
|
|||||||
return
|
return
|
||||||
|
|
||||||
while (Transport.jobs_running):
|
while (Transport.jobs_running):
|
||||||
sleep(0.01)
|
sleep(0.0005)
|
||||||
|
|
||||||
if Transport.identity == None:
|
if Transport.identity == None:
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user