Provides the ability to communicate over a network using SocketIO (https://socket.io/docs/v4/).
More...
Provides the ability to communicate over a network using SocketIO (https://socket.io/docs/v4/).
Definition at line 50 of file SocketIO.h.
◆ SocketIO()
| SocketIO::SocketIO |
( |
QObject * | parent = 0 | ) |
|
|
explicitprotected |
Constructs a SocketIO instance.
- Parameters
-
| [in] | parent | The parent QObject. |
◆ ~SocketIO()
Destructor.
Cleans up the SocketIO connection.
◆ addChannel()
Adds an existing channel to this connection.
- Parameters
-
| [in] | channel | The channel to add. |
◆ connect()
| bool SocketIO::connect |
( |
const StringView & | url = "http://ndevr.org:3000" | ) |
|
Connects to a SocketIO server at the given URL.
- Parameters
-
| [in] | url | The server URL to connect to. |
- Returns
- True if the connection was successful.
References url().
◆ createChannel() [1/2]
Creates a new communication channel with a data receive callback.
- Parameters
-
| [in] | name | The channel name. |
| [in] | data_callback | Callback invoked when data is received on this channel. |
| [in] | target | The UUID of the target client, or invalid for broadcast. |
- Returns
- A shared pointer to the created SocketIOChannel.
◆ createChannel() [2/2]
Creates a new communication channel with the given name.
- Parameters
-
| [in] | name | The channel name. |
| [in] | target | The UUID of the target client, or invalid for broadcast. |
- Returns
- A shared pointer to the created SocketIOChannel.
◆ GetSocketIO()
Gets or creates a shared SocketIO instance for the given URL.
- Parameters
-
| [in] | url | The server URL to connect to. |
- Returns
- A shared pointer to the SocketIO instance.
References url().
◆ isConnected()
| bool SocketIO::isConnected |
( |
| ) |
const |
|
inline |
Checks whether the client is currently connected.
- Returns
- True if connected to the server.
Definition at line 108 of file SocketIO.h.
◆ onlineClients()
Gets the dictionary of currently online clients.
- Returns
- A reference to the dictionary mapping client UUIDs to names.
◆ removeChannel()
Removes a channel from this connection.
- Parameters
-
| [in] | channel | The channel to remove. |
◆ setName()
Sets the display name for this client.
- Parameters
-
| [in] | name | The name to identify this client. |
◆ setRunID()
| void SocketIO::setRunID |
( |
const UUID & | run_id | ) |
|
Sets the run ID for this session.
- Parameters
-
| [in] | run_id | The UUID identifying this run. |
◆ url()
| const String & SocketIO::url |
( |
| ) |
const |
|
inline |
The documentation for this class was generated from the following file: