From fb33ac6d1b3704347646acc17de770fb629ad241 Mon Sep 17 00:00:00 2001 From: Colin Date: Sun, 22 Oct 2023 12:36:57 +0000 Subject: [PATCH] sxmo_suspend: fix reversed getpeername -> getsockname --- hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh b/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh index 0b0b4411..1b379c5c 100755 --- a/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh +++ b/hosts/modules/gui/sxmo/hooks/sxmo_suspend.sh @@ -79,10 +79,7 @@ class Suspender: def ntfy_port(self) -> (int, int|None): ''' returns (remote port, local port) ''' remote_port = NTFY_PORT_BASE + self.wowlan_delay - try: - local_port = self.ntfy_socket.getpeername()[1] - except: - local_port = None # it errors if e.g. socket disconnects + local_port = self.ntfy_socket.getsockname()[1] if self.ntfy_socket is not None else None return remote_port, local_port def open_ntfy_stream(self):