Improved LocalInterface detach

This commit is contained in:
Mark Qvist 2025-01-16 15:57:43 +01:00
parent 1709cd929a
commit b8aa6a3e44

View File

@ -246,12 +246,14 @@ class LocalClientInterface(Interface):
self.detached = True
try:
self.socket.shutdown(socket.SHUT_RDWR)
if self.socket != None:
self.socket.shutdown(socket.SHUT_RDWR)
except Exception as e:
RNS.log("Error while shutting down socket for "+str(self)+": "+str(e))
try:
self.socket.close()
if self.socket != None:
self.socket.close()
except Exception as e:
RNS.log("Error while closing socket for "+str(self)+": "+str(e))