lib/httpx/io/tcp.rb in httpx-1.0.2 vs lib/httpx/io/tcp.rb in httpx-1.1.0
- old
+ new
@@ -39,11 +39,11 @@
end
@ip_index = @addresses.size - 1
end
def socket
- @io.to_io
+ @io
end
def add_addresses(addrs)
return if addrs.empty?
@@ -93,10 +93,12 @@
@io = build_socket
retry
end
def try_connect
- case @io.connect_nonblock(Socket.sockaddr_in(@port, @ip.to_s), exception: false)
+ ret = @io.connect_nonblock(Socket.sockaddr_in(@port, @ip.to_s), exception: false)
+ log(level: 3, color: :cyan) { "TCP CONNECT: #{ret}..." }
+ case ret
when :wait_readable
@interests = :r
return
when :wait_writable
@interests = :w