Permalink
Browse files

Merge pull request #10 from kyledrake/keepalive

Add keepalive to socket
  • Loading branch information...
2 parents 6d2e74d + f8259a9 commit b96ff64aea64ecfcac382c6e992c7e5cdb3f635b @alindeman alindeman committed Jun 20, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/grocer/ssl_connection.rb
@@ -28,9 +28,10 @@ def connect
context.cert = OpenSSL::X509::Certificate.new(cert_data)
end
- @sock = TCPSocket.new(gateway, port)
- @ssl = OpenSSL::SSL::SSLSocket.new(@sock, context)
- @ssl.sync = true
+ @sock = TCPSocket.new(gateway, port)
+ @sock.setsockopt Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true
+ @ssl = OpenSSL::SSL::SSLSocket.new(@sock, context)
+ @ssl.sync = true
@ssl.connect
end

0 comments on commit b96ff64

Please sign in to comment.