From b96cbf1014c23eb5c5401f51ae8fb979e6b2382f Mon Sep 17 00:00:00 2001 From: 4c3e <97980799+4c3e@users.noreply.github.com> Date: Fri, 21 Jan 2022 01:34:55 +0000 Subject: [PATCH] OSX NameError fix Had the following error when trying to run Reticulum on OSX High Sierra: line 115, in set_timeouts_osx sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) NameError: name 'sock' is not defined This fix resolved the problem for me. --- RNS/Interfaces/TCPInterface.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RNS/Interfaces/TCPInterface.py b/RNS/Interfaces/TCPInterface.py index 08dde19..c5a9287 100644 --- a/RNS/Interfaces/TCPInterface.py +++ b/RNS/Interfaces/TCPInterface.py @@ -112,8 +112,8 @@ class TCPClientInterface(Interface): else: TCP_KEEPIDLE = 0x10 - sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) - sock.setsockopt(socket.IPPROTO_TCP, TCP_KEEPIDLE, int(TCPClientInterface.TCP_PROBE_AFTER)) + self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1) + self.socket.setsockopt(socket.IPPROTO_TCP, TCP_KEEPIDLE, int(TCPClientInterface.TCP_PROBE_AFTER)) def detach(self): if self.socket != None: @@ -421,4 +421,4 @@ class TCPInterfaceHandler(socketserver.BaseRequestHandler): socketserver.BaseRequestHandler.__init__(self, *args, **keys) def handle(self): - self.callback(handler=self) \ No newline at end of file + self.callback(handler=self)