listen

listen(backlog=Socket::SOMAXCONN) Instance Public methods creates a listening socket bound to self.

pfamily

addrinfo.pfamily => integer Instance Public methods returns the protocol family as an integer. Addrinfo.tcp("localhost", 80).pfamily == Socket::PF_INET #=> true

protocol

addrinfo.protocol => integer Instance Public methods returns the socket type as an integer. Addrinfo.tcp("localhost", 80).protocol == Socket::IPPROTO_TCP #=> true

socktype

addrinfo.socktype => integer Instance Public methods returns the socket type as an integer. Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true

to_s

addrinfo.to_sockaddr => stringaddrinfo.to_s => string Instance Public methods returns the socket address as packed struct sockaddr string. Addrinfo.tcp("localhost", 80).to_sockaddr #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"

to_sockaddr

addrinfo.to_sockaddr => string Instance Public methods returns the socket address as packed struct sockaddr string. Addrinfo.tcp("localhost", 80).to_sockaddr #=> "\x02\x00\x00P\x7F\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00"

unix?

addrinfo.unix? => true or false Instance Public methods returns true if addrinfo is UNIX address. returns false otherwise. Addrinfo.tcp("127.0.0.1", 80).unix? #=> false Addrinfo.tcp("::1", 80).unix? #=> false Addrinfo.unix("/tmp/sock").unix? #=> true

unix_path

addrinfo.unix_path => path Instance Public methods Returns the socket path as a string. Addrinfo.unix("/tmp/sock").unix_path #=> "/tmp/sock"

new

new(*args) Class Public methods

new

new(*args) Class Public methods