Skip to content

Commit

Permalink
Merge pull request #187 from nelgau/really-disable-nodelay
Browse files Browse the repository at this point in the history
Ensure TCP_NODELAY is disabled by fixing namespacing
  • Loading branch information
michaelklishin committed Feb 14, 2014
2 parents 9575098 + 18ebd5d commit 7f57ef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bunny/cruby/socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Socket < TCPSocket
def self.open(host, port, options = {})
Timeout.timeout(options[:socket_timeout], ClientTimeout) do
sock = new(host, port)
if Socket.constants.include?('TCP_NODELAY') || Socket.constants.include?(:TCP_NODELAY)
if ::Socket.constants.include?('TCP_NODELAY') || ::Socket.constants.include?(:TCP_NODELAY)
sock.setsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, true)
end
sock.setsockopt(::Socket::SOL_SOCKET, ::Socket::SO_KEEPALIVE, true) if options.fetch(:keepalive, true)
Expand Down

0 comments on commit 7f57ef8

Please sign in to comment.