InetAddress

Members

Aliases

Addr
alias Addr = sockaddr_in6

Constants and aliases.

Addr
alias Addr = sockaddr_in
Undocumented in source.

Functions

address_n
void[] address_n()

Obtains a slice to the binary address in from this.addr, that is, for IPv4 the sin_addr or for IPv6 the sin6_addr field, respectively.

clear
void clear()

Clears this.addr.

getnameinfo
int getnameinfo(mstring host, mstring serv, GetNameInfoFlags flags)
Undocumented in source. Be warned that the author may not have intended to support it.
inet_ntop
mstring inet_ntop(mstring dst)

Renders the current address of this.addr as an IP address string, writing to dst. dst.length is expected to be at least this.addstrlength.

inet_pton
int inet_pton(cstring ip_address_str)

Sets the address field (sin_addr/sin6_addr) of this.addr to the address represented by the string in src. src is expected to contain a valid IP address.

inet_pton
int inet_pton(char* ip_address_str)

Sets the address field (sin_addr/sin6_addr) of this.addr to the address in ip_address_str. ip_address_str is expected be a NUL-terminated string.

opAssign
sockaddr* opAssign(Addr addr)

Copies addr to this.addr.

opAssign
sockaddr* opAssign(Addr* addr)

Copies *addr to this.addr.

opCall
sockaddr* opCall(cstring ip_address_str, ushort port)

Sets this.addr to the IP address in ip_address_str and the port to port.

opCall
sockaddr* opCall(ushort port)

Sets this.addr to the wildcard "any" IP address and the port to port.

port
ushort port()

Gets the port number from this.addr.

port
ushort port(ushort p)

Sets the port field (sin_port/sin6_port) of this.addr to p.

setAddressAny
sockaddr* setAddressAny()

Sets this.addr to the wildcard "any" IP address.

Manifest constants

addrstrlen
enum addrstrlen;
Undocumented in source.
addrstrlen
enum addrstrlen;
Undocumented in source.
family
enum family;
Undocumented in source.
family
enum family;
Undocumented in source.

Variables

addr
Addr addr;

Internet address struct instance. The address and port fields should be accessed by port() and inet_pton()/inet_ntop() unless they are copied from another instance.

addr_init
enum Addr addr_init;

Constants and aliases.

addr_init
enum Addr addr_init;
Undocumented in source.

Meta