|
MongoDB
2.5.0
|
helper for manipulating host:port connection endpoints. More...
#include <hostandport.h>
Public Member Functions | |
| HostAndPort (const std::string &s) | |
| From a string hostname[:portnumber] Throws user assertion if bad config string or bad port #. | |
| HostAndPort (const std::string &h, int p) | |
| HostAndPort (const SockAddr &sock) | |
| bool | operator< (const HostAndPort &r) const |
| bool | operator== (const HostAndPort &r) const |
| bool | operator!= (const HostAndPort &r) const |
| bool | isSelf () const |
| bool | isLocalHost () const |
| string | toString (bool includePort=true) const |
| operator string () const | |
| void | append (StringBuilder &ss) const |
| bool | empty () const |
| string | host () const |
| int | port () const |
| bool | hasPort () const |
| void | setPort (int port) |
Static Public Member Functions | |
| static HostAndPort | me () |
helper for manipulating host:port connection endpoints.
|
inline |
| p | port number. -1 is ok to use default. |
|
inline |
| includePort | host:port if true, host otherwise |
1.8.3.1