From 804370d964486ab0ac51a7402e6b30fced5d31af Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 2 Apr 2009 18:35:59 +0000 Subject: (svn r15914) -Codechange: let the content handling make use of NetworkAddress. --- src/network/core/address.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/network/core/address.h') 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) { @@ -73,6 +73,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 -- cgit v1.2.3-70-g09d2