Skip to content

End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

Addrinfo.tcp

Addrinfo.tcp(host, port) => addrinfo

returns an addrinfo object for TCP address.

Example
Addrinfo.tcp("localhost", "smtp") #=> #<Addrinfo: 127.0.0.1:25 TCP (localhost:smtp)>
See also .new .udp .ip .unix also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0