The AIO socket library works around opening a socket with an attached handler that is then asynchronously called when datta is put to the socket.
More...
The AIO socket library works around opening a socket with an attached handler that is then asynchronously called when datta is put to the socket.
Opening a socket
char *addr = NULL;
aIO_handle_t aIOOpenUDPSocket(char *s_addr, in_port_t port, size_t buffer_size, void(*callback)(size_t, char *, void *), void *args)
Definition: AsyncIO.c:495
void vUDPHandlerOne(size_t read_size, char *buffer, void *args)
Definition: async_sockets.c:43
aIO_handle_t udp_soc_one
Definition: async_sockets.c:36
#define UDP_BUFFER_SIZE
Definition: async_sockets.h:64
#define UDP_TEST_PORT_1
Definition: async_sockets.h:65
Socket handler
void vTCPHandler(
size_t read_size,
char *buffer,
void *args)
{
prints(
"TCP Recv: %s\n", buffer);
}
void vTCPHandler(size_t read_size, char *buffer, void *args)
Definition: async_sockets.c:143
void prints(const char *__format,...)
Prints a formatted string to stdout
Definition: gfx_print.c:104
Putting to socket
strlen(test_str_1));
int aIOSocketPut(aIO_socket_e protocol, char *s_addr, in_port_t port, char *buffer, size_t buffer_size)
Send the data stored in buffer to the socket described by s_addr and port.
Definition: AsyncIO.c:291
@ UDP
Definition: AsyncIO.h:58
◆ TCP_BUFFER_SIZE
#define TCP_BUFFER_SIZE 2000 |
◆ TCP_TEST_PORT
#define TCP_TEST_PORT 2222 |
◆ UDP_BUFFER_SIZE
#define UDP_BUFFER_SIZE 2000 |
◆ UDP_TEST_PORT_1
#define UDP_TEST_PORT_1 1234 |
◆ UDP_TEST_PORT_2
#define UDP_TEST_PORT_2 4321 |
◆ vDeleteSocketTasks()
void vDeleteSocketTasks |
( |
void |
| ) |
|
◆ xCreateSocketTasks()
int xCreateSocketTasks |
( |
void |
| ) |
|
Creates the UDP and TCP demo tasks used for demonstration purposes.
- Returns
- 0 on success
◆ tcp_soc
◆ TCPDemoTask
◆ udp_soc_one
◆ udp_soc_two
◆ UDPDemoTask