IpAddress

Encapsulate an IPv4 network address.

IpAddress is a utility class for manipulating network addresses.

It provides a set a implicit constructors and conversion functions to easily build or transform an IP address from/to various representations.

Constructors

this
this(string address)

Construct the address from a string.

this
this(ubyte byte0, ubyte byte1, ubyte byte2, ubyte byte3)

Construct the address from 4 bytes.

this
this(uint address)

Construct the address from a 32-bits integer.

Members

Functions

toInteger
int toInteger()

Get an integer representation of the address.

toString
string toString()

Get a string representation of the address.

Static functions

getLocalAddress
IpAddress getLocalAddress()

Get the computer's local address.

getPublicAddress
IpAddress getPublicAddress(Duration timeout)

Get the computer's public address.

Static variables

Broadcast
immutable(IpAddress) Broadcast;

The "broadcast" address (for sending UDP messages to everyone on a local network)

LocalHost
immutable(IpAddress) LocalHost;

The "localhost" address (for connecting a computer to itself locally)

None
immutable(IpAddress) None;

Value representing an empty/invalid address.

Variables

m_address
char[16] m_address;
Undocumented in source.

Meta