try:
        # enable keepalive probes
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_KEEPALIVE, 1)
        # the interval between subsequential keepalive probes, regardless of what the connection has exchanged in the meantime
        # overrides  tcp_keepalive_intvl