Improved link status detection and recovery of TCP interfaces over unreliable IP links.

This commit is contained in:
Mark Qvist 2021-09-23 16:07:57 +02:00
parent aaf0ace027
commit acae9e34c2
3 changed files with 94 additions and 33 deletions

View file

@ -57,9 +57,12 @@ class UDPInterface(Interface):
self.owner.inbound(data, self)
def processOutgoing(self,data):
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
udp_socket.sendto(data, (self.forward_ip, self.forward_port))
try:
udp_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
udp_socket.sendto(data, (self.forward_ip, self.forward_port))
except Exception as e:
RNS.log("Could not transmit on "+str(self)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def __str__(self):