Reset connection list on UPnP

- reset the already attempted connection list after UPnP port mapping is
  established. This allows to resubmit externally reachable port
master
Peter Šurda 6 years ago
parent 59e1739136
commit 42246f83ef
Signed by untrusted user: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87
  1. 5
      src/upnp.py

@ -220,6 +220,11 @@ class uPnPThread(threading.Thread, StoppableThread):
self.routers.append(newRouter)
self.createPortMapping(newRouter)
queues.UISignalQueue.put(('updateStatusBar', tr._translate("MainWindow",'UPnP port mapping established on port %1').arg(str(self.extPort))))
# retry connections so that the submitted port is refreshed
with shared.alreadyAttemptedConnectionsListLock:
shared.alreadyAttemptedConnectionsList.clear()
shared.alreadyAttemptedConnectionsListResetTime = int(
time.time())
break
except socket.timeout as e:
pass

Loading…
Cancel
Save