Fix for issue #100 : Let possible to start the server on an address other than localhost
Add a new function for keeping the API stable
This commit is contained in:
@@ -44,13 +44,21 @@ class Server {
|
||||
// create() constructs and returns a new Server.
|
||||
static std::unique_ptr<Server> create();
|
||||
|
||||
// start() begins listening for connections on the given port.
|
||||
// start() begins listening for connections on localhost and the given port.
|
||||
// callback will be called for each connection.
|
||||
// onError will be called for any connection errors.
|
||||
virtual bool start(int port,
|
||||
const OnConnect& callback,
|
||||
const OnError& onError = ignoreErrors) = 0;
|
||||
|
||||
// start() begins listening for connections on the given specific address and port.
|
||||
// callback will be called for each connection.
|
||||
// onError will be called for any connection errors.
|
||||
virtual bool start(const char* address,
|
||||
int port,
|
||||
const OnConnect& callback,
|
||||
const OnError& onError = ignoreErrors) = 0;
|
||||
|
||||
// stop() stops listening for connections.
|
||||
// stop() is implicitly called on destruction.
|
||||
virtual void stop() = 0;
|
||||
|
||||
Reference in New Issue
Block a user