IpAddress

Encapsulate an IPv4 network address.

Constructors

this
this(const(char)[] 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
const(char)[] toString()

Get a string representation of the address.

Static functions

getLocalAddress
IpAddress getLocalAddress()

Get the computer's local address.

getPublicAddress
IpAddress getPublicAddress(Duration timeout = Duration.zero())

Get the computer's public address.

Static variables

Any
immutable(IpAddress) Any;

Value representing any address (0.0.0.0)

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.

Meta