(socket utility) move ix::getFreePort to ixwebsocket library
This commit is contained in:
@@ -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