You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# @attribute [Array] The host specification array.
36
35
attr:specification
37
36
@@ -47,31 +46,126 @@ def service
47
46
@specification[1]
48
47
end
49
48
50
-
# Try to connect to the given host by connecting to each address in sequence until a connection is made.
51
-
# @yields {|socket| ...} If a block is given, yields the connected socket (may be invoked multiple times during connection attempts).
52
-
# @parameter socket [Socket] The socket which is being connected.
53
-
# @returns [Socket] the connected socket
54
-
# @raise if no connection could complete successfully
55
-
defconnect(wrapper=self.wrapper, &block)
56
-
last_error=nil
49
+
# Try to connect ot the given host using the given wrapper.
50
+
#
51
+
# The implementation uses Happy Eyeballs (RFC 8305) algorithm if it makes sense to do so. This attempts IPv6 and IPv4 connections in parallel, preferring IPv6 but starting IPv4 attempts after a short delay to improve connection speed.
52
+
#
53
+
# @parameter happy_eyeballs_delay [Float] Delay in seconds before starting IPv4 connections (defaults to @options[:happy_eyeballs_delay] or 0.05)
54
+
# @yields {|socket| ...} the socket which is being connected, may be invoked more than once.
55
+
# @returns [Socket] the connected socket.
56
+
# @raises if no connection could complete successfully.
0 commit comments