Send a closedown to server (deleting peer record) when the proxy port times out
This commit is contained in:
parent
d7e9ae9a4a
commit
259c48f63c
|
@ -124,7 +124,7 @@ class Proxy(DatagramProtocol):
|
||||||
return
|
return
|
||||||
#for _dport in self.connTrack:
|
#for _dport in self.connTrack:
|
||||||
while True:
|
while True:
|
||||||
_dport = random.randint(1,(self.numPorts - 2))
|
_dport = random.randint(1,(self.numPorts - 1))
|
||||||
_dport = _dport + self.destPortStart
|
_dport = _dport + self.destPortStart
|
||||||
if not self.connTrack[_dport]:
|
if not self.connTrack[_dport]:
|
||||||
break
|
break
|
||||||
|
@ -147,7 +147,7 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
Master = "127.0.0.1"
|
Master = "127.0.0.1"
|
||||||
ListenPort = 62031
|
ListenPort = 62031
|
||||||
DestportStart = 50000
|
DestportStart = 5000
|
||||||
DestPortEnd = 50600
|
DestPortEnd = 50600
|
||||||
Timeout = 30
|
Timeout = 30
|
||||||
Stats = True
|
Stats = True
|
||||||
|
@ -159,9 +159,10 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
CONNTRACK = {}
|
CONNTRACK = {}
|
||||||
|
|
||||||
for port in range(DestportStart,DestPortEnd,1):
|
for port in range(DestportStart,DestPortEnd+1,1):
|
||||||
CONNTRACK[port] = False
|
CONNTRACK[port] = False
|
||||||
|
|
||||||
|
|
||||||
reactor.listenUDP(ListenPort,Proxy(Master,ListenPort,CONNTRACK,BlackList,Timeout,Debug,DestportStart,DestPortEnd))
|
reactor.listenUDP(ListenPort,Proxy(Master,ListenPort,CONNTRACK,BlackList,Timeout,Debug,DestportStart,DestPortEnd))
|
||||||
|
|
||||||
def loopingErrHandle(failure):
|
def loopingErrHandle(failure):
|
||||||
|
|
Loading…
Reference in New Issue