From bbdfb1ea54d1b1366c069a14885ddd6f74246ba2 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sun, 22 Nov 2015 23:13:26 +0100 Subject: [PATCH] UPnP cleaner shutdown --- src/upnp.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/upnp.py b/src/upnp.py index c4c40b44..eebf68cf 100644 --- a/src/upnp.py +++ b/src/upnp.py @@ -106,6 +106,7 @@ class Router: self.localAddress = s.getsockname()[0] logger.debug("Local IP: %s", self.localAddress) try: + s.shutdown(socket.SHUT.RDWR) s.close() except: pass @@ -203,6 +204,7 @@ class uPnPThread(threading.Thread, StoppableThread): for router in self.routers: if router.extPort is None: self.createPortMapping(router) + self.sock.shutdown(socket.SHUT.RDWR) self.sock.close() for router in self.routers: if router.extPort is not None: