33#include "Base/Headers/String.h"
34#include "Base/Headers/UUID.h"
43 friend class SocketIO;
54 lib_assert(
name.size() > 0 && !
name.contains(
'|'),
"Bad Socket channel name");
66 lib_assert(
name.size() > 0 && !
name.contains(
'|'),
"Bad Socket channel name");
UUID m_target
The target client UUID, or invalid for broadcast.
SocketIOChannel(const StringView &name, std::function< void(const char *data, uint04 size)> data_callback, UUID target=Constant< UUID >::Invalid)
Constructs a channel with a data receive callback.
std::function< void(const char *data, uint04 size)> m_send_data_callback
Callback for outgoing data.
String m_name
The channel name.
void sendData(const char *data, uint04 size)
Sends data over this channel.
std::function< void(const char *data, uint04 size)> m_recieve_data_callback
Callback for incoming data.
SocketIOChannel(const StringView &name, UUID target=Constant< UUID >::Invalid)
Constructs a channel with the given name and optional target.
void setRecieveDataCallback(std::function< void(const char *data, uint04 size)> data_callback)
Sets the callback to invoke when data is received on this channel.
const UUID & target() const
Gets the target UUID for this channel.
void recieveData(const char *data, uint04 size)
Dispatches received data to the receive callback.
void setSendDataCallback(std::function< void(const char *data, uint04 size)> data_callback)
Sets the callback used to send data through the SocketIO connection.
const String & name() const
Gets the name of this channel.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
A universally unique identifier (UUID) is a 128-bit number used to identify information in computer s...
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...