Currently only IPv4 addresses are supported, but this class may encapsulate IPv6 addresses as well in the future.
|
Public Types |
typedef unsigned int | port |
| The type used to represent a port.
|
Public Methods |
| inet_address () |
| Constructs an empty address.
|
| inet_address (port pt) |
| Constructs an address from a port (using INADDR_ANY as the host).
|
| inet_address (string ip, port pt=0) |
| Constructs an address from a host name and port.
|
| inet_address (string ip, string pt) |
| Constructs an address from a host name and port string.
|
| inet_address (const address &other) |
| Coerces an address to an IP address, yielding an empty address if the address is not an IP address.
|
string | get_host () const |
| Returns the host as a dotted-quad string.
|
string | get_hostname () const |
| Returns the hostname, as obtained by gethostbyaddr.
|
port | get_port () const |
| Returns the port (or zero if none).
|
string | as_string () const |
| Returns a human-readable version of this address.
|
| NMSTL_SIMPLY_SERIALIZABLE (inet_address,<< addr) |
Static Public Methods |
string | local_hostname () |
Protected Methods |
const sockaddr_in * | inetaddr () const |