diff --git a/RNS/Interfaces/TCPInterface.py b/RNS/Interfaces/TCPInterface.py index 1757685..5c99034 100644 --- a/RNS/Interfaces/TCPInterface.py +++ b/RNS/Interfaces/TCPInterface.py @@ -26,12 +26,13 @@ class TCPClientInterface(Interface): def __init__(self, owner, name, target_ip=None, target_port=None, connected_socket=None): self.IN = True self.OUT = False - self.transmit_delay = 0.001 self.socket = None self.parent_interface = None - self.name = name + # TODO: Optimise so this is not needed + self.transmit_delay = 0.001 + if connected_socket != None: self.receives = True self.target_ip = None @@ -61,6 +62,7 @@ class TCPClientInterface(Interface): def processOutgoing(self, data): if self.online: try: + time.sleep(self.transmit_delay) data = bytes([HDLC.FLAG])+HDLC.escape(data)+bytes([HDLC.FLAG]) self.socket.sendall(data) except Exception as e: diff --git a/RNS/Interfaces/UdpInterface.py b/RNS/Interfaces/UdpInterface.py index 58cfa8a..d52f39f 100755 --- a/RNS/Interfaces/UdpInterface.py +++ b/RNS/Interfaces/UdpInterface.py @@ -11,6 +11,8 @@ class UdpInterface(Interface): def __init__(self, owner, name, bindip=None, bindport=None, forwardip=None, forwardport=None): self.IN = True self.OUT = False + + # TODO: Optimise so this is not needed self.transmit_delay = 0.001 self.name = name