mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
WSServer(stop): wait for all connections to close
This commit is contained in:
parent
5fd95ce374
commit
bc3b09dce4
@ -121,13 +121,11 @@ void WSServer::stop()
|
||||
for (connection_hdl hdl : _connections) {
|
||||
_server.close(hdl, websocketpp::close::status::going_away, "Server stopping");
|
||||
}
|
||||
_connections.clear();
|
||||
_connectionProperties.clear();
|
||||
|
||||
_threadPool.waitForDone();
|
||||
|
||||
while (!_server.stopped()) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
while (_connections.size() > 0) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
}
|
||||
|
||||
blog(LOG_INFO, "server stopped successfully");
|
||||
|
Loading…
x
Reference in New Issue
Block a user