mongo::HostAndPort Struct Reference
helper for manipulating host:port connection endpoints.
More...
#include <hostandport.h>
List of all members.
Public Member Functions |
|
| HostAndPort (string s) |
| | From a string hostname[:portnumber] Throws user assertion if bad config string or bad port #.
|
| | HostAndPort (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 |
|
string | host () const |
|
int | port () const |
|
bool | hasPort () const |
|
void | setPort (int port) |
Static Public Member Functions |
|
static HostAndPort | me () |
|
static HostAndPort | Me () |
Detailed Description
helper for manipulating host:port connection endpoints.
Constructor & Destructor Documentation
| mongo::HostAndPort::HostAndPort |
( |
string |
h, |
|
|
int |
p | |
|
) |
| | [inline] |
- Parameters:
-
| p | port number. -1 is ok to use default. |
Member Function Documentation
| string mongo::HostAndPort::toString |
( |
bool |
includePort = true |
) |
const [inline] |
- Parameters:
-
| includePort | host:port if true, host otherwise |
The documentation for this struct was generated from the following file: