#include <coherence/net/InetAddress.hpp>
Inherits Object.
Public Types | ||||
| typedef spec::Handle | Handle | |||
| InetAddress Handle definition. | ||||
| typedef spec::View | View | |||
| InetAddress View definition. | ||||
| typedef spec::Holder | Holder | |||
| InetAddress Holder definition. | ||||
Public Member Functions | ||||
| virtual String::View | getHostName () const | |||
| Return the hostname associated with this address. | ||||
| virtual String::View | getHostAddress () const | |||
| Return the address in textual form. | ||||
| virtual Array < octet_t >::View | getAddress () const | |||
| Return the raw IP address, in network byte order, with the highest order byte stored at index zero. | ||||
| virtual void | toStream (std::ostream &out) const | |||
| Output a human-readable description of this Object to the given stream. coherence::lang::operator<<(std::ostream, Object::View) is defined and will call into the toStream method, to output Objects. If a managed String object is desired, the COH_TO_STRING macro can be used to build up a String from streamable contents.
Object::View vKey = ... Object::View vValue = ... std::cout << vKey << " = " << vValue << std::endl; String::Handle hs = COH_TO_STRING(vKey << " = " << vValue);
| ||||
| virtual bool | equals (Object::View that) const | |||
| virtual size32_t | hashCode () const | |||
| Return a hash code value for the Object. This method is supported for the benefit of hash-based containers.
The general contract of
The default implementation is identity based.
| ||||
Static Public Member Functions | ||||
| static InetAddress::View | getLocalHost () | |||
| Return the InetAddress for the local machine. | ||||
| static InetAddress::View | getByName (String::View vHost) | |||
| Return the InetAddress for the specified machine name. | ||||
Protected Member Functions | ||||
| InetAddress (String::View vsHost, Array< octet_t >::View vaIP) | ||||
| Manually construct an InetAddress from a network byte ordered array. | ||||
| InetAddress (const InetAddress &) | ||||
| Copy Constructor. | ||||
| InetAddress | ( | String::View | vsHost, | |
| Array< octet_t >::View | vaIP | |||
| ) | [protected] |
Manually construct an InetAddress from a network byte ordered array.
It is recommended that the getByName() method be used in place of manual InetAddress construction.
| vsName | the name of the host | |
| vaIP | the array representation of the host's IP address. |
| static InetAddress::View getLocalHost | ( | ) | [static] |
| static InetAddress::View getByName | ( | String::View | vHost | ) | [static] |
Return the InetAddress for the specified machine name.
| vHost | the name or IP of the host to resolve |
| virtual String::View getHostName | ( | ) | const [virtual] |
Return the hostname associated with this address.
| virtual String::View getHostAddress | ( | ) | const [virtual] |
Return the address in textual form.
Return the raw IP address, in network byte order, with the highest order byte stored at index zero.