new

new(irb, workspace = nil, input_method = nil, output_method = nil) Class Public methods Creates a new IRB context. The optional input_method argument: nil uses stdin or Readline String uses a File other uses this as InputMethod

recvfrom

ipsocket.recvfrom(maxlen) => [mesg, ipaddr]ipsocket.recvfrom(maxlen, flags) => [mesg, ipaddr] Instance Public methods Receives a message and return the message as a string and an address which the message come from. maxlen is the maximum number of bytes to receive. flags should be a bitwise OR of Socket::MSG_* constants. ipaddr is same as IPSocket#{peeraddr,addr}. u1 = UDPSocket.new u1.bind("127.0.0.1", 4913) u2 = UDPSocket.new u2.send "uuuu", 0, "127.0.0.1", 4913 p u

peeraddr

ipsocket.peeraddr([reverse_lookup]) => [address_family, port, hostname, numeric_address] Instance Public methods Returns the remote address as an array which contains address_family, port, hostname and numeric_address. It is defined for connection oriented socket such as TCPSocket. If reverse_lookup is true or :hostname, hostname is obtained from numeric_address using reverse lookup. Or if it is false, or :numeric, hostname is same as numeric_address. Or if it is nil or ommitte

addr

ipsocket.addr([reverse_lookup]) => [address_family, port, hostname, numeric_address] Instance Public methods Returns the local address as an array which contains address_family, port, hostname and numeric_address. If reverse_lookup is true or :hostname, hostname is obtained from numeric_address using reverse lookup. Or if it is false, or :numeric, hostname is same as numeric_address. Or if it is nil or ommitted, obeys to ipsocket.do_not_reverse_lookup. See Socket.getaddrinfo al

getaddress

IPSocket.getaddress(host) => ipaddress Class Public methods Lookups the IP address of host. IPSocket.getaddress("localhost") #=> "127.0.0.1" IPSocket.getaddress("ip6-localhost") #=> "::1" getaddress_orig

set

set(addr, *family) Instance Protected methods Set +@addr+, the internal stored ip address, to given addr. The parameter addr is validated using the first family member, which is Socket::AF_INET or Socket::AF_INET6.

mask!

mask!(mask) Instance Protected methods Set current netmask to given mask.

~

~() Instance Public methods Returns a new ipaddr built by bitwise negation.

|

|(other) Instance Public methods Returns a new ipaddr built by bitwise OR.

to_string

to_string() Instance Public methods Returns a string containing the IP address representation in canonical form.