mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-19 17:37:43 +00:00
WSConnection clean shutdown, fix hubTrigger ownership (it's deleted by the event loop)
This commit is contained in:
@ -149,7 +149,7 @@ struct MsgNegentropy : NonCopyable {
|
||||
|
||||
|
||||
struct RelayServer {
|
||||
std::unique_ptr<uS::Async> hubTrigger;
|
||||
uS::Async *hubTrigger = nullptr;
|
||||
|
||||
// Thread Pools
|
||||
|
||||
|
@ -39,7 +39,7 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
|
||||
};
|
||||
|
||||
uWS::Hub hub;
|
||||
uWS::Group<uWS::SERVER> *hubGroup;
|
||||
uWS::Group<uWS::SERVER> *hubGroup = nullptr;
|
||||
flat_hash_map<uint64_t, Connection*> connIdToConnection;
|
||||
uint64_t nextConnectionId = 1;
|
||||
bool gracefulShutdown = false;
|
||||
@ -219,7 +219,7 @@ void RelayServer::runWebsocket(ThreadPool<MsgWebsocket>::Thread &thr) {
|
||||
}
|
||||
};
|
||||
|
||||
hubTrigger = std::make_unique<uS::Async>(hub.getLoop());
|
||||
hubTrigger = new uS::Async(hub.getLoop());
|
||||
hubTrigger->setData(&asyncCb);
|
||||
|
||||
hubTrigger->start([](uS::Async *a){
|
||||
|
Reference in New Issue
Block a user