Reputation: 15922
In any socket API the close() method closes a connection with a FIN. If I want to abort a connection with a RST how can I do it?
Upvotes: 2
Views: 980
Reputation: 14716
With a normal Ruby TCPSocket, you can turn on SO_LINGER by doing something like this:
linger = [1,0].pack('ii')
socket.setsockopt(Socket::SOL_SOCKET, Socket::SO_LINGER, linger)
socket.close
Upvotes: 5