diff options
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r-- | src/network/core/address.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h index 62e79f3de..30d86b5e8 100644 --- a/src/network/core/address.h +++ b/src/network/core/address.h @@ -40,9 +40,9 @@ public: * @param ip the unresolved hostname * @param port the port */ - NetworkAddress(const char *hostname, uint16 port) : + NetworkAddress(const char *hostname = NULL, uint16 port = 0) : resolved(false), - hostname(strdup(hostname)), + hostname(hostname == NULL ? NULL : strdup(hostname)), ip(0), port(port) { @@ -74,6 +74,12 @@ public: const char *GetHostname() const; /** + * Get the address as a string, e.g. 127.0.0.1:12345. + * @return the address + */ + const char *GetAddressAsString() const; + + /** * Get the IP address. If the IP has not been resolved yet this will resolve * it possibly blocking this function for a while * @return the IP address |