UPnP cleaner shutdown
This commit is contained in:
parent
e4a7e71790
commit
bbdfb1ea54
|
@ -106,6 +106,7 @@ class Router:
|
||||||
self.localAddress = s.getsockname()[0]
|
self.localAddress = s.getsockname()[0]
|
||||||
logger.debug("Local IP: %s", self.localAddress)
|
logger.debug("Local IP: %s", self.localAddress)
|
||||||
try:
|
try:
|
||||||
|
s.shutdown(socket.SHUT.RDWR)
|
||||||
s.close()
|
s.close()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
@ -203,6 +204,7 @@ class uPnPThread(threading.Thread, StoppableThread):
|
||||||
for router in self.routers:
|
for router in self.routers:
|
||||||
if router.extPort is None:
|
if router.extPort is None:
|
||||||
self.createPortMapping(router)
|
self.createPortMapping(router)
|
||||||
|
self.sock.shutdown(socket.SHUT.RDWR)
|
||||||
self.sock.close()
|
self.sock.close()
|
||||||
for router in self.routers:
|
for router in self.routers:
|
||||||
if router.extPort is not None:
|
if router.extPort is not None:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user