diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-24 17:20:36 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-24 17:20:36 +0200 |
commit | 610ececb74d5efb4ed4df54dbceaa54fcbcf99e5 (patch) | |
tree | 4cfa485ebd00103bcb7cd7c139435bc0c92088e4 /src/net/connectionhandler.hpp | |
parent | af12180611e2c0520ee4974d5246e474fd8e704e (diff) | |
download | manaserv-610ececb74d5efb4ed4df54dbceaa54fcbcf99e5.tar.gz manaserv-610ececb74d5efb4ed4df54dbceaa54fcbcf99e5.tar.bz2 manaserv-610ececb74d5efb4ed4df54dbceaa54fcbcf99e5.tar.xz manaserv-610ececb74d5efb4ed4df54dbceaa54fcbcf99e5.zip |
Made it possible to specify the host to listen on
Needed when the server has multiple network interfaces and the one you
want to use isn't the default one for localhost.
The host to listen on can be set in config file with 'net_listenHost'.
Diffstat (limited to 'src/net/connectionhandler.hpp')
-rw-r--r-- | src/net/connectionhandler.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/net/connectionhandler.hpp b/src/net/connectionhandler.hpp index d22224a7..8c8ecf40 100644 --- a/src/net/connectionhandler.hpp +++ b/src/net/connectionhandler.hpp @@ -23,6 +23,7 @@ #define _TMWSERV_CONNECTIONHANDLER_H_ #include <list> +#include <string> #include <enet/enet.h> class MessageIn; @@ -41,8 +42,11 @@ class ConnectionHandler /** * Open the server socket. + * @param port the port to listen to + * @host the host IP to listen on, defaults to the default localhost */ - bool startListen(enet_uint16 port); + bool startListen(enet_uint16 port, + const std::string &host = std::string()); /** * Disconnect all the clients and close the server socket. |