HiveMindBridge
Public Member Functions | List of all members
ITCPServer Class Referenceabstract

#include <ITCPServer.h>

Inheritance diagram for ITCPServer:
Inheritance graph
Collaboration diagram for ITCPServer:
Collaboration graph

Public Member Functions

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
 

Member Function Documentation

◆ close()

virtual void ITCPServer::close ( )
pure virtual

Terminate a client connection.

Implemented in TCPServer.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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.

Here is the caller graph for this function:

◆ 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
hookThe function to be run

Implemented in TCPServer.

Here is the caller graph for this function:

◆ 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
hookThe function to be run

Implemented in TCPServer.

Here is the caller graph for this function:

◆ receive()

virtual bool ITCPServer::receive ( uint8_t *  data,
uint16_t  length 
)
pure virtual

Read data from socket.

Parameters
dataThe buffer on which the incoming data will be written.
lengthThe 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
dataThe buffer containing the data to send.
lengthThe length of the data on the buffer.

Implemented in TCPServer.


The documentation for this class was generated from the following file: