lib/server.rb in winescout-redis-rb-0.0.3 vs lib/server.rb in winescout-redis-rb-0.0.3.1
- old
+ new
@@ -89,12 +89,9 @@
def connect_to(host, port, timeout=nil)
addrs = Socket.getaddrinfo(host, nil)
addr = addrs.detect { |ad| ad[0] == 'AF_INET' }
sock = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
- #addr = Socket.getaddrinfo(host, nil)
- #sock = Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)
-
if timeout
secs = Integer(timeout)
usecs = Integer((timeout - secs) * 1_000_000)
optval = [secs, usecs].pack("l_2")
sock.setsockopt Socket::SOL_SOCKET, Socket::SO_RCVTIMEO, optval