InternetAddress

Encapsulates an IPv4 (Internet Protocol version 4) socket address.

Consider using getAddress, parseAddress and Address methods instead of using this class directly.

Constructors

this
this(const(char)[] addr, ushort port)

Construct a new InternetAddress.

this
this(uint addr, ushort port)
this(ushort port)

Construct a new InternetAddress.

this
this(sockaddr_in addr)

Construct a new InternetAddress.

Members

Functions

opEquals
bool opEquals(Object o)

Provides support for comparing equality with another InternetAddress of the same type.

toAddrString
string toAddrString()

Human readable string representing the IPv4 address in dotted-decimal form.

toHostNameString
string toHostNameString()

Attempts to retrieve the host name as a fully qualified domain name.

toPortString
string toPortString()

Human readable string representing the IPv4 port.

Properties

addr
uint addr [@property getter]

Returns the IPv4 address number (in host byte order).

port
ushort port [@property getter]

Returns the IPv4 port number (in host byte order).

Static functions

addrToString
string addrToString(uint addr)

Convert an IPv4 address number in host byte order to a human readable string representing the IPv4 address in dotted-decimal form.

parse
uint parse(const(char)[] addr)

Parse an IPv4 address string in the dotted-decimal form a.b.c.d and return the number.

Variables

ADDR_ANY
enum uint ADDR_ANY;

Any IPv4 host address.

ADDR_NONE
enum uint ADDR_NONE;

An invalid IPv4 host address.

PORT_ANY
enum ushort PORT_ANY;

Any IPv4 port number.

Inherited Members

From Address

name
sockaddr* name [@property getter]

Returns pointer to underlying sockaddr structure.

nameLen
socklen_t nameLen [@property getter]

Returns actual size of underlying sockaddr structure.

addressFamily
AddressFamily addressFamily [@property getter]

Family of this address.

toAddrString
string toAddrString()

Attempts to retrieve the host address as a human-readable string.

toHostNameString
string toHostNameString()

Attempts to retrieve the host name as a fully qualified domain name.

toPortString
string toPortString()

Attempts to retrieve the numeric port number as a string.

toServiceNameString
string toServiceNameString()

Attempts to retrieve the service name as a string.

toString
string toString()

Human readable string representing this address.

Meta