Send a closedown to server (deleting peer record) when the proxy port times out

This commit is contained in:
Simon 2021-01-05 18:37:49 +00:00
parent d7e9ae9a4a
commit 259c48f63c
1 changed files with 4 additions and 3 deletions

View File

@ -124,7 +124,7 @@ class Proxy(DatagramProtocol):
return
#for _dport in self.connTrack:
while True:
_dport = random.randint(1,(self.numPorts - 2))
_dport = random.randint(1,(self.numPorts - 1))
_dport = _dport + self.destPortStart
if not self.connTrack[_dport]:
break
@ -147,7 +147,7 @@ if __name__ == '__main__':
Master = "127.0.0.1"
ListenPort = 62031
DestportStart = 50000
DestportStart = 5000
DestPortEnd = 50600
Timeout = 30
Stats = True
@ -159,8 +159,9 @@ if __name__ == '__main__':
CONNTRACK = {}
for port in range(DestportStart,DestPortEnd,1):
for port in range(DestportStart,DestPortEnd+1,1):
CONNTRACK[port] = False
reactor.listenUDP(ListenPort,Proxy(Master,ListenPort,CONNTRACK,BlackList,Timeout,Debug,DestportStart,DestPortEnd))