From 632d74c6b1a17f3bc3419158dfc1bb5a2e5f77b5 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 3 Apr 2009 01:24:52 +0000 Subject: (svn r15922) -Codechange: unify the ways to listen on a socket --- src/network/core/address.h | 12 ++++++++++-- 1 file changed, 10 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 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 */ -- cgit v1.2.3-70-g09d2