Skip to content
instance method

Addrinfo#to_sockaddr

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

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_s #unix? #socktype #unix_path also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0