(svn r15914) -Codechange: let the content handling make use of NetworkAddress.

This commit is contained in:
rubidium
2009-04-02 18:35:59 +00:00
parent b2e7941783
commit 804370d964
5 changed files with 29 additions and 12 deletions

View File

@@ -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