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,11 +246,13 @@ class LocalClientInterface(Interface):
self.detached = True self.detached = True
try: try:
if self.socket != None:
self.socket.shutdown(socket.SHUT_RDWR) self.socket.shutdown(socket.SHUT_RDWR)
except Exception as e: except Exception as e:
RNS.log("Error while shutting down socket for "+str(self)+": "+str(e)) RNS.log("Error while shutting down socket for "+str(self)+": "+str(e))
try: try:
if self.socket != None:
self.socket.close() self.socket.close()
except Exception as e: except Exception as e:
RNS.log("Error while closing socket for "+str(self)+": "+str(e)) RNS.log("Error while closing socket for "+str(self)+": "+str(e))