Skip to content
instance method

Addrinfo#to_s

() -> ::String
addrinfo.to_s => string

Alias of #to_sockaddr

returns the socket address as packed struct sockaddr string.

Example
Addrinfo.tcp("localhost", 80).to_sockaddr
#=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"
See also #to_sockaddr #socktype #protocol #unix? also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0