Exception handling

This commit is contained in:
mailchuck 2015-11-23 01:35:11 +01:00
parent 15d435a8e7
commit d86fbfffc3
Signed by untrusted user who does not match committer: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -214,8 +214,14 @@ 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)
try:
self.sock.shutdown(socket.SHUT_RDWR) self.sock.shutdown(socket.SHUT_RDWR)
except:
pass
try:
self.sock.close() self.sock.close()
except:
pass
deleted = False deleted = False
for router in self.routers: for router in self.routers:
if router.extPort is not None: if router.extPort is not None: