mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 23:40:18 +00:00
Cleanup
This commit is contained in:
parent
3a2b12f9ad
commit
d121562b22
@ -26,12 +26,13 @@ class TCPClientInterface(Interface):
|
|||||||
def __init__(self, owner, name, target_ip=None, target_port=None, connected_socket=None):
|
def __init__(self, owner, name, target_ip=None, target_port=None, connected_socket=None):
|
||||||
self.IN = True
|
self.IN = True
|
||||||
self.OUT = False
|
self.OUT = False
|
||||||
self.transmit_delay = 0.001
|
|
||||||
self.socket = None
|
self.socket = None
|
||||||
self.parent_interface = None
|
self.parent_interface = None
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
|
|
||||||
|
# TODO: Optimise so this is not needed
|
||||||
|
self.transmit_delay = 0.001
|
||||||
|
|
||||||
if connected_socket != None:
|
if connected_socket != None:
|
||||||
self.receives = True
|
self.receives = True
|
||||||
self.target_ip = None
|
self.target_ip = None
|
||||||
@ -61,6 +62,7 @@ class TCPClientInterface(Interface):
|
|||||||
def processOutgoing(self, data):
|
def processOutgoing(self, data):
|
||||||
if self.online:
|
if self.online:
|
||||||
try:
|
try:
|
||||||
|
time.sleep(self.transmit_delay)
|
||||||
data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG])
|
data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG])
|
||||||
self.socket.sendall(data)
|
self.socket.sendall(data)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -11,6 +11,8 @@ class UdpInterface(Interface):
|
|||||||
def __init__(self, owner, name, bindip=None, bindport=None, forwardip=None, forwardport=None):
|
def __init__(self, owner, name, bindip=None, bindport=None, forwardip=None, forwardport=None):
|
||||||
self.IN = True
|
self.IN = True
|
||||||
self.OUT = False
|
self.OUT = False
|
||||||
|
|
||||||
|
# TODO: Optimise so this is not needed
|
||||||
self.transmit_delay = 0.001
|
self.transmit_delay = 0.001
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
|
Loading…
Reference in New Issue
Block a user