summaryrefslogtreecommitdiff
path: root/src/network/core/address.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-04-03 01:24:52 +0000
committerrubidium <rubidium@openttd.org>2009-04-03 01:24:52 +0000
commit632d74c6b1a17f3bc3419158dfc1bb5a2e5f77b5 (patch)
tree3d2dcf19488a31930bdb82d46f8ddc4b53aba59a /src/network/core/address.h
parentba5aafb9bba4887b502dba32e56747fe10af604e (diff)
downloadopenttd-632d74c6b1a17f3bc3419158dfc1bb5a2e5f77b5.tar.xz
(svn r15922) -Codechange: unify the ways to listen on a socket
Diffstat (limited to 'src/network/core/address.h')
-rw-r--r--src/network/core/address.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/network/core/address.h b/src/network/core/address.h
index 3e8ca0343..c42805add 100644
--- a/src/network/core/address.h
+++ b/src/network/core/address.h
@@ -52,8 +52,8 @@ public:
* @param ip the unresolved hostname
* @param port the port
*/
- NetworkAddress(const char *hostname = NULL, uint16 port = 0) :
- hostname(hostname == NULL ? NULL : strdup(hostname)),
+ NetworkAddress(const char *hostname = "0.0.0.0", uint16 port = 0) :
+ hostname(strdup(hostname)),
address_length(0)
{
memset(&this->address, 0, sizeof(this->address));
@@ -159,6 +159,14 @@ public:
* @return the connected socket or INVALID_SOCKET.
*/
SOCKET Connect();
+
+ /**
+ * Make the given socket listen.
+ * @param family the type of 'protocol' (IPv4, IPv6)
+ * @param socktype the type of socket (TCP, UDP, etc)
+ * @return the listening socket or INVALID_SOCKET.
+ */
+ SOCKET Listen(int family, int socktype);
};
#endif /* ENABLE_NETWORK */