struct

Socket::IPAddress

Inherits Socket::Address < Struct < Value < Object

IP address representation.

Holds a binary representation of an IP address, either translated from a String, or directly received from an opened connection (e.g. Socket#local_address, Socket#receive).

IPAddress won't resolve domains, including localhost. If you must resolve an IP, or don't know whether a String contains an IP or a domain name, you should use Addrinfo.resolve instead.

Constants

HYBRID_IPV6_PREFIX_BYTES = Bytes[0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 0_u8, 255_u8, 255_u8]

Class methods

aton(address : String) : UInt32
Source
ipv6_groups(address : String) : Array(Int32)
Source
parse(slice : Bytes, family : Family, with_port : Bool = false) : Socket::IPAddress
Source

Instance methods

to_slice(slice : Bytes, with_port : Bool = true) : Bytes
Source
to_slice
Source