TCP stream client — sends input to the server and receives state updates.
More...
#include <Client.hpp>
TCP stream client — sends input to the server and receives state updates.
◆ LocalPlayerReadyFn
◆ init()
| bool Client::init |
( |
const char * |
addr, |
|
|
Uint16 |
port |
|
) |
| |
Create the TCP socket and connect to the server.
- Parameters
-
| addr | Hostname or IP address of the server. |
| port | TCP port the server is listening on. |
- Returns
- False on socket creation or DNS failure.
◆ onLocalPlayerReady()
◆ poll()
| bool Client::poll |
( |
Registry & |
registry | ) |
|
Receive and process one pending message.
- Returns
- True if a message was received, false if the queue is empty.
◆ send()
| bool Client::send |
( |
const void * |
data, |
|
|
uint32_t |
size |
|
) |
| |
Send a raw message to the server.
- Parameters
-
| data | Pointer to the payload bytes. |
| size | Payload length in bytes. |
- Returns
- False if the send fails.
◆ sendInputSnapshot()
◆ shutdown()
| void Client::shutdown |
( |
| ) |
|
Close the socket and release the resolved address.
The documentation for this class was generated from the following files: