echo_server_misc.c
error_t socketSend(Socket *socket, const void *data, size_t length, size_t *written, uint_t flags)
Send data to a connected socket.
Definition: socket.c:1486
char_t buffer[ECHO_SERVER_TCP_BUFFER_SIZE]
Memory buffer for input/output operations (TCP)
Definition: echo_server.h:152
char_t * ipAddrToString(const IpAddr *ipAddr, char_t *str)
Convert a binary IP address to a string representation.
Definition: ip.c:805
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.
error_t socketReceive(Socket *socket, void *data, size_t size, size_t *received, uint_t flags)
Receive data from a connected socket.
Definition: socket.c:1692
int_t socket(int_t family, int_t type, int_t protocol)
Create a socket that is bound to a specific transport service provider.
Definition: bsd_socket.c:65
error_t socketReceiveFrom(Socket *socket, IpAddr *srcIpAddr, uint16_t *srcPort, void *data, size_t size, size_t *received, uint_t flags)
Receive a datagram from a connectionless socket.
Definition: socket.c:1714
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
Socket * socketAccept(Socket *socket, IpAddr *clientIpAddr, uint16_t *clientPort)
Permit an incoming connection attempt on a socket.
Definition: socket.c:1451
Helper functions for Echo server.
error_t socketSendTo(Socket *socket, const IpAddr *destIpAddr, uint16_t destPort, const void *data, size_t length, size_t *written, uint_t flags)
Send a datagram to a specific destination.
Definition: socket.c:1507
void echoServerRegisterTcpConnectionEvents(EchoTcpConnection *connection, SocketEventDesc *eventDesc)
Register TCP connection events.
Definition: echo_server_misc.c:159
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.
char_t udpBuffer[ECHO_SERVER_UDP_BUFFER_SIZE]
Memory buffer for input/output operations (UDP)
Definition: echo_server.h:176
error_t socketSetTimeout(Socket *socket, systime_t timeout)
Set timeout value for blocking operations.
Definition: socket.c:148
Debugging facilities.