Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Addrinfo#connect_internal

connect_internal(local_addrinfo, timeout=nil) { |socket| ... }

creates a new Socket connected to the address of local_addrinfo.

If local_addrinfo is nil, the address of the socket is not bound.

The timeout specify the seconds for timeout. Errno::ETIMEDOUT is raised when timeout occur.

If a block is given the created socket is yielded for each address.