SHARE
TWEET

Untitled

a guest Nov 19th, 2019 129 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) # socket keepalive
  2. socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPIDLE, 3) # activate after 3 seconds of idleness
  3. socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPINTVL, 5) # send ping once every 5 seconds
  4. socket.setsockopt(Socket::SOL_TCP, Socket::TCP_KEEPCNT, 5) # and after 5 failed ping close connection
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top