struct Socket::IPAddress

Overview

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.

Defined in:

ext/socket/address.cr

Constructors

Constructor Detail

def self.from(sockaddr_in : Pointer(LibC::SockaddrIn) | Pointer(LibC::SockaddrIn6), addrlen) : IPAddress #

[View source]