mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 23:40:18 +00:00
Fixed socket references. Closes #146.
This commit is contained in:
parent
87b73b6c67
commit
f22e5cc200
@ -527,18 +527,17 @@ class I2PInterfacePeer(Interface):
|
|||||||
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
|
||||||
self.socket.setsockopt(socket.IPPROTO_TCP, TCP_KEEPIDLE, int(I2PInterfacePeer.I2P_PROBE_AFTER))
|
self.socket.setsockopt(socket.IPPROTO_TCP, TCP_KEEPIDLE, int(I2PInterfacePeer.I2P_PROBE_AFTER))
|
||||||
|
|
||||||
def shutdown_socket(self, socket):
|
def shutdown_socket(self, target_socket):
|
||||||
if callable(socket.close):
|
if callable(target_socket.close):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if self.socket != None:
|
if socket != None:
|
||||||
socket.shutdown(socket.SHUT_RDWR)
|
target_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:
|
if socket != None:
|
||||||
socket.close()
|
target_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))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user