#include <ITCPServer.h>
|
virtual void | listen ()=0 |
|
virtual bool | receive (uint8_t *data, uint16_t length)=0 |
|
virtual bool | send (const uint8_t *data, uint16_t length)=0 |
|
virtual void | close ()=0 |
|
virtual bool | isClientConnected ()=0 |
|
virtual void | onConnect (std::function< void()> hook)=0 |
|
virtual void | onDisconnect (std::function< void()> hook)=0 |
|
◆ close()
virtual void ITCPServer::close |
( |
| ) |
|
|
pure virtual |
Terminate a client connection.
Implemented in TCPServer.
◆ isClientConnected()
virtual bool ITCPServer::isClientConnected |
( |
| ) |
|
|
pure virtual |
See if the server has a client connected
- Returns
- true if the TCP server has a client connected.
Implemented in TCPServer.
◆ listen()
virtual void ITCPServer::listen |
( |
| ) |
|
|
pure virtual |
Start listening for incoming client connections and accept one client. This is blocking until a client connects.
Implemented in TCPServer.
◆ onConnect()
virtual void ITCPServer::onConnect |
( |
std::function< void()> |
hook | ) |
|
|
pure virtual |
Register a callback to be run when a TCP connection is established with a client HiveMind
- Parameters
-
hook | The function to be run |
Implemented in TCPServer.
◆ onDisconnect()
virtual void ITCPServer::onDisconnect |
( |
std::function< void()> |
hook | ) |
|
|
pure virtual |
Register a callback to be run as soon as the TCP Server notices that the connection was lost.
- Parameters
-
hook | The function to be run |
Implemented in TCPServer.
◆ receive()
virtual bool ITCPServer::receive |
( |
uint8_t * |
data, |
|
|
uint16_t |
length |
|
) |
| |
|
pure virtual |
Read data from socket.
- Parameters
-
data | The buffer on which the incoming data will be written. |
length | The length of the provided buffer. |
- Returns
- The length of the data read.
Implemented in TCPServer.
◆ send()
virtual bool ITCPServer::send |
( |
const uint8_t * |
data, |
|
|
uint16_t |
length |
|
) |
| |
|
pure virtual |
Send some data to the client.
- Parameters
-
data | The buffer containing the data to send. |
length | The length of the data on the buffer. |
Implemented in TCPServer.
The documentation for this class was generated from the following file: