Open bobmcnamara opened 2 years ago
on macOS it is TCP_KEEPALIVE
Here is the offending code:
if attribute_state is True:
self.interface.sock.setsockopt(
socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1
)
self.interface.sock.setsockopt(
socket.IPPROTO_TCP, socket.TCP_KEEPIDLE, 60
)
self.interface.sock.setsockopt(
socket.IPPROTO_TCP, socket.TCP_KEEPINTVL, 60
)
self.interface.sock.setsockopt(
socket.IPPROTO_TCP, socket.TCP_KEEPCNT, 5
)
self.keepalive = True
The problem is that on macOS, the socket module has no attribute TCP_KEEPIDLE.
The keepalive code for TCPIPInstrVxi11 and TCPIPSocketSession is broken on OSX. Specifically, socket.TCP_KEEPIDLE doesn't exist on OSX.
Here is the code I tried to run:
Here is the error:
See https://stackoverflow.com/questions/12248132/how-to-change-tcp-keepalive-timer-using-python-script for more details.