WebSocketSession: Add connectedAt

This commit is contained in:
tt2468 2021-04-28 11:12:53 -07:00
parent 1245958031
commit 0af2724ee9
2 changed files with 15 additions and 0 deletions

View File

@ -3,6 +3,7 @@
#include "plugin-macros.generated.h"
WebSocketSession::WebSocketSession() :
_connectedAt(0),
_incomingMessages(0),
_outgoingMessages(0),
_encoding(0),
@ -15,6 +16,16 @@ WebSocketSession::WebSocketSession() :
{
}
uint64_t WebSocketSession::ConnectedAt()
{
return _connectedAt.load();
}
void WebSocketSession::SetConnectedAt(uint64_t at);
{
_connectedAt.store(at);
}
uint64_t WebSocketSession::IncomingMessages()
{
return _incomingMessages.load();

View File

@ -9,6 +9,9 @@ class WebSocketSession
public:
WebSocketSession();
uint64_t ConnectedAt();
void SetConnectedAt(uint64_t at);
uint64_t IncomingMessages();
void IncrementIncomingMessages();
@ -37,6 +40,7 @@ class WebSocketSession
void SetEventSubscriptions(uint64_t subscriptions);
private:
std::atomic<uint64_t> _connectedAt;
std::atomic<uint64_t> _incomingMessages;
std::atomic<uint64_t> _outgoingMessages;
std::atomic<uint8_t> _encoding;