sxmo_suspend.sh: explicitly shutdown the socket

This commit is contained in:
2023-10-22 11:00:21 +00:00
parent 30529182b0
commit 230ca20017

View File

@@ -83,8 +83,11 @@ class Suspender:
def close_ntfy_stream(self):
''' call before exit to ensure socket is cleanly shut down and not leaked '''
if self.ntfy_socket is not None:
try:
self.ntfy_socket.shutdown(socket.SHUT_RDWR)
self.ntfy_socket.close()
except:
pass # shutdown can error if the socket was already terminated (by the remote)
def configure_wowlan(self):
# TODO: don't do this wowlan stuff every single time.