37 #ifndef _TCPLISTENER_H_
38 #define _TCPLISTENER_H_
44 template <
class SOCKET, u
int8_t MAX_CLIENTS>
63 for (
int i = 0; i < MAX_CLIENTS; i++)
65 SOCKET& sck = clients[i];
nint16_t localPort
local TCP or UDP port
void listen(uint16_t port)
Starts to listen on the specified TCP port.
void onTerminate()
Called when the socket is ready to be reused.
void listen()
Starts listening on the local port indicated by the localPort property.
static const uint8_t SCK_STATE_CLOSED
(both server and client) represents no connection state at all.
SOCKET clients[MAX_CLIENTS]
void onConnectRequest()
Called when a listening socket receives a connection request.
virtual void onNoMoreConnections()
Called when there are no more sockets available
Maintains a list of available sockets, also listening and spawning sockets to serve multiple clients ...
Implements the TCP protocol.