IPv4Address

Constructors

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

-port- can be PORT_ANY -addr- is an IP address or host name

this
this(sockaddr* addr)

Members

Enums

ADDR_ANY
anonymousenum ADDR_ANY

Functions

toString
string toString()

Properties

addr
uint addr [@property getter]
addressFamily
AddressFamily addressFamily [@property getter]
name
sockaddr* name [@property getter]
nameLen
int nameLen [@property getter]
port
ushort port [@property getter]
toAddrString
char[] toAddrString [@property getter]
toPortString
char[] toPortString [@property getter]

Static functions

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

-addr- is an IP address in the format "a.b.c.d" returns ADDR_NONE on failure

Structs

sockaddr_in
struct sockaddr_in

Inherited Members

From Address

sockaddr
struct sockaddr
Undocumented in source.
addrinfo
struct addrinfo
Undocumented in source.
name
sockaddr* name [@property getter]
Undocumented in source.
nameLen
int nameLen [@property getter]
Undocumented in source.
exception
void exception(immutable(char)[] msg)

Tango: added this common function

create
Address create(sockaddr* sa)

Address factory

resolve
Address resolve(const(char)[] host, const(char)[] service, AddressFamily af, AIFlags flags)
resolve
Address resolve(const(char)[] host, ushort port, AddressFamily af, AIFlags flags)
resolveAll
Address[] resolveAll(const(char)[] host, const(char)[] service, AddressFamily af, AIFlags flags)
resolveAll
Address[] resolveAll(const(char)[] host, ushort port, AddressFamily af, AIFlags flags)
passive
Address passive(const(char)[] service, AddressFamily af, AIFlags flags)
passive
Address passive(ushort port, AddressFamily af, AIFlags flags)
toAddrString
char[] toAddrString [@property getter]
toPortString
char[] toPortString [@property getter]
toString
string toString()
addressFamily
AddressFamily addressFamily [@property getter]

Examples

IPv4Address ia = new IPv4Address("63.105.9.61", 80);
assert(ia.toString() == "63.105.9.61:80");

Meta