server: handle requests in a separate thread

This commit is contained in:
Stéphane Lepin 2019-04-26 13:39:18 +02:00
parent 1ec69cbc0d
commit 2d84ad8963

View File

@ -166,6 +166,7 @@ void WSServer::onMessage(connection_hdl hdl, server::message_ptr message)
return;
}
QtConcurrent::run([=]() {
std::string payload = message->get_payload();
QMutexLocker locker(&_clMutex);
@ -184,6 +185,7 @@ void WSServer::onMessage(connection_hdl hdl, server::message_ptr message)
// In our case, it's fine because all messages are processed in one thread.
_connectionProperties[hdl] = connProperties;
locker.unlock();
});
}
void WSServer::onClose(connection_hdl hdl)