summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-02 18:35:59 +0000
committerrubidium <rubidium@openttd.org>2009-04-02 18:35:59 +0000
commit804370d964486ab0ac51a7402e6b30fced5d31af (patch)
tree4f4462080d78106349d22df1edc1ff6cd3edef1b /src/network/core/address.h
parentb2e79417833a04bfe5d486e30e5b8fc4a5aec8bb (diff)
downloadopenttd-804370d964486ab0ac51a7402e6b30fced5d31af.tar.xz
(svn r15914) -Codechange: let the content handling make use of NetworkAddress.
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r--src/network/core/address.h10
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