Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) # socket keepalive
- socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, 3) # activate after 3 seconds of idleness
- socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPINTVL, 5) # send ping once every 5 seconds
- socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPCNT, 5) # and after 5 failed ping close connection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement