ixwebsocketserver::broadcast server to return a boolean to know whether the server could start/listen, and use that in ws
This commit is contained in:
@ -201,15 +201,15 @@ namespace ix
|
||||
});
|
||||
}
|
||||
|
||||
int WebSocketServer::listenAndStart()
|
||||
bool WebSocketServer::listenAndStart()
|
||||
{
|
||||
auto res = listen();
|
||||
if (!res.first)
|
||||
{
|
||||
return 1;
|
||||
return false;
|
||||
}
|
||||
|
||||
start();
|
||||
return 0;
|
||||
return true;
|
||||
}
|
||||
} // namespace ix
|
||||
|
@ -48,7 +48,7 @@ namespace ix
|
||||
std::set<std::shared_ptr<WebSocket>> getClients();
|
||||
|
||||
void makeBroadcastServer();
|
||||
int listenAndStart();
|
||||
bool listenAndStart();
|
||||
|
||||
const static int kDefaultHandShakeTimeoutSecs;
|
||||
|
||||
|
Reference in New Issue
Block a user