mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
WebSocketSession: Add challenge var
This commit is contained in:
parent
98bc18cedd
commit
0f7683af4e
@ -13,6 +13,19 @@ WebSocketSession::WebSocketSession() :
|
||||
{
|
||||
}
|
||||
|
||||
std::string WebSocketSession::Challenge()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(challengeMutex);
|
||||
std::string ret(challenge);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void WebSocketSession::SetChallenge(std::string challengeString)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(challengeMutex);
|
||||
challenge = challengeString;
|
||||
}
|
||||
|
||||
uint64_t WebSocketSession::IncomingMessages()
|
||||
{
|
||||
return incomingMessages.load();
|
||||
|
@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <atomic>
|
||||
|
||||
class WebSocketSession
|
||||
@ -7,6 +9,9 @@ class WebSocketSession
|
||||
public:
|
||||
WebSocketSession();
|
||||
|
||||
std::string Challenge();
|
||||
void SetChallenge(std::string challenge);
|
||||
|
||||
uint64_t IncomingMessages();
|
||||
void IncrementIncomingMessages();
|
||||
|
||||
@ -29,6 +34,8 @@ class WebSocketSession
|
||||
void SetEventSubscriptions(uint64_t subscriptions);
|
||||
|
||||
private:
|
||||
std::mutex challengeMutex;
|
||||
std::string challenge;
|
||||
std::atomic<uint64_t> incomingMessages;
|
||||
std::atomic<uint64_t> outgoingMessages;
|
||||
std::atomic<uint8_t> rpcVersion;
|
||||
|
Loading…
Reference in New Issue
Block a user