echo_server.c
void echoServerDeinit(EchoServerContext *context)
Release Echo server context.
Definition: echo_server.c:455
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
Definition: os_port_chibios.c:80
error_t socketBind(Socket *socket, const IpAddr *localIpAddr, uint16_t localPort)
Associate a local address with a socket.
Definition: socket.c:1316
void echoServerGetDefaultSettings(EchoServerSettings *settings)
Initialize settings with default values.
Definition: echo_server.c:54
void echoServerProcessTcpConnectionEvents(EchoTcpConnection *connection)
Connection event handler.
Definition: echo_server_misc.c:187
void echoServerAcceptTcpConnection(EchoServerContext *context)
Accept connection request.
Definition: echo_server_misc.c:87
Echo server.
Socket * socketOpen(uint_t type, uint_t protocol)
Create a socket (UDP or TCP)
Definition: socket.c:125
void echoServerTick(EchoServerContext *context)
Handle periodic operations.
Definition: echo_server_misc.c:49
EchoTcpConnection tcpConnection[ECHO_SERVER_MAX_TCP_CONNECTIONS]
TCP connections.
Definition: echo_server.h:172
error_t socketPoll(SocketEventDesc *eventDesc, uint_t size, OsEvent *extEvent, systime_t timeout)
Wait for one of a set of sockets to become ready to perform I/O.
Definition: socket.c:2149
error_t echoServerInit(EchoServerContext *context, const EchoServerSettings *settings)
Initialize Echo server context.
Definition: echo_server.c:76
Helper functions for Echo server.
void echoServerRegisterTcpConnectionEvents(EchoTcpConnection *connection, SocketEventDesc *eventDesc)
Register TCP connection events.
Definition: echo_server_misc.c:159
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
Definition: os_port_chibios.c:202
void echoServerCloseTcpConnection(EchoTcpConnection *connection)
Close TCP connection.
Definition: echo_server_misc.c:250
void echoServerProcessUdpDatagram(EchoServerContext *context)
Process incoming UDP datagram.
Definition: echo_server_misc.c:269
TCP/IP stack core.
error_t socketSetTimeout(Socket *socket, systime_t timeout)
Set timeout value for blocking operations.
Definition: socket.c:148
Debugging facilities.
error_t socketListen(Socket *socket, uint_t backlog)
Place a socket in the listening state.
Definition: socket.c:1413