Struct NetworkAddress
Represents a network/socket address.
struct NetworkAddress
;
To construct a NetworkAddress
, use either resolveHost
or set the
family
property accordingly, followed by setting the fields of
sockAddrInet4
/sockAddrInet6
/sockAddrUnix
.
Properties
Name | Type | Description |
---|---|---|
family [get, set]
|
ushort | Family of the socket address. |
port [get, set]
|
ushort | The port in host byte order. |
sockAddr [get]
|
inout(core | A pointer to a sockaddr struct suitable for passing to socket functions. |
sockAddrInet4 [get]
|
inout(core | |
sockAddrInet6 [get]
|
inout(core | |
sockAddrLen [get]
|
int | Size of the sockaddr struct that is returned by sockAddr(). |
sockAddrUnix [get]
|
inout(core |
Methods
Name | Description |
---|---|
toAddressString
()
|
Returns a string representation of the IP address |
toString
()
|
Returns a full string representation of the address, including the port number. |