(socket utility) move ix::getFreePort to ixwebsocket library
This commit is contained in:
1 parent
5940e53d77
commit
4f41f209a2
10 files changed
+20
-10
No files matched your search
@@ -19,11 +19,7 @@ namespace snake
|
||||
public:
|
||||
virtual ~SnakeConnectionState()
|
||||
{
|
||||
if (subscriptionThread.joinable())
|
||||
{
|
||||
subscriptionRedisClient.stop();
|
||||
subscriptionThread.join();
|
||||
}
|
||||
stopSubScriptionThread();
|
||||
}
|
||||
|
||||
std::string getNonce()
|
||||
@@ -61,6 +57,15 @@ namespace snake
|
||||
return _redisClient;
|
||||
}
|
||||
|
||||
void stopSubScriptionThread()
|
||||
{
|
||||
if (subscriptionThread.joinable())
|
||||
{
|
||||
subscriptionRedisClient.stop();
|
||||
subscriptionThread.join();
|
||||
}
|
||||
}
|
||||
|
||||
// We could make those accessible through methods
|
||||
std::thread subscriptionThread;
|
||||
std::string appChannel;
|
||||
|
||||
@@ -261,7 +261,7 @@ namespace snake
|
||||
auto body = pdu["body"];
|
||||
auto subscriptionId = body["subscription_id"];
|
||||
|
||||
state->redisClient().stop();
|
||||
state->stopSubScriptionThread();
|
||||
|
||||
nlohmann::json response = {{"action", "rtm/unsubscribe/ok"},
|
||||
{"id", pduId},
|
||||
|
||||
Reference in new issue
Block a user