ndmspc v1.2.0-0.1.rc7
Loading...
Searching...
No Matches
NWsClientInfo.h
1#ifndef NDMSPC_NWS_CLIENT_INFO_H
2#define NDMSPC_NWS_CLIENT_INFO_H
3
4#include <string> // For std::string
5#include <chrono> // For std::chrono::system_clock
6#include "Rtypes.h" // For ULong_t
7
8namespace Ndmspc {
9
17 private:
18 ULong_t fWsId;
19 std::string fUsername;
21 std::chrono::system_clock::time_point fConnectedAt;
22
23 public:
28
34 NWsClientInfo(ULong_t id, const std::string & username);
35
40 ULong_t GetWsId() const;
41
46 const std::string & GetUsername() const;
47
52 int GetMessageCount() const;
53
58 std::chrono::system_clock::time_point GetConnectedAt() const;
59
64 void SetUsername(const std::string & username);
65
70
71};
72
73} // namespace Ndmspc
74
75#endif // NDMSPC_NWS_CLIENT_INFO_H
std::string fUsername
Username associated with the client.
ULong_t GetWsId() const
Get the WebSocket client ID.
int GetMessageCount() const
Get the message count for the client.
NWsClientInfo()
Default constructor.
ULong_t fWsId
Unique WebSocket client ID.
std::chrono::system_clock::time_point GetConnectedAt() const
Get the connection start time for the client.
std::chrono::system_clock::time_point fConnectedAt
Connection start time.
const std::string & GetUsername() const
Get the username of the client.
void SetUsername(const std::string &username)
Set the username for the client.
int fMessageCount
Number of messages sent/received.
void IncrementMessageCount()
Increment the message count for the client.
Global callback function for libwebsockets client events.