libcoap 4.3.1
|
Internal API for Application Input / Output checking. More...
Functions | |
unsigned int | coap_io_prepare_io (coap_context_t *ctx, coap_socket_t *sockets[], unsigned int max_sockets, unsigned int *num_sockets, coap_tick_t now) |
Iterates through all the coap_socket_t structures embedded in endpoints or sessions associated with the ctx to determine which are wanting any read, write, accept or connect I/O (COAP_SOCKET_WANT_xxx is set). More... | |
void | coap_io_do_io (coap_context_t *ctx, coap_tick_t now) |
Processes any outstanding read, write, accept or connect I/O as indicated in the coap_socket_t structures (COAP_SOCKET_CAN_xxx set) embedded in endpoints or sessions associated with ctx . More... | |
unsigned int | coap_io_prepare_epoll (coap_context_t *ctx, coap_tick_t now) |
Any now timed out delayed packet is transmitted, along with any packets associated with requested observable response. More... | |
void | coap_io_do_epoll (coap_context_t *ctx, struct epoll_event *events, size_t nevents) |
Process all the epoll events. More... | |
Internal API for Application Input / Output checking.
void coap_io_do_epoll | ( | coap_context_t * | ctx, |
struct epoll_event * | events, | ||
size_t | nevents | ||
) |
Process all the epoll events.
Note: If epoll support is compiled into libcoap, coap_io_do_epoll() must be used instead of coap_io_do_io().
Internal function
ctx | The current CoAP context. |
events | The list of events returned from an epoll_wait() call. |
nevents | The number of events. |
Definition at line 1935 of file net.c.
void coap_io_do_io | ( | coap_context_t * | ctx, |
coap_tick_t | now | ||
) |
Processes any outstanding read, write, accept or connect I/O as indicated in the coap_socket_t structures (COAP_SOCKET_CAN_xxx set) embedded in endpoints or sessions associated with ctx
.
Note: If epoll support is compiled into libcoap, coap_io_do_epoll() must be used instead of coap_io_do_io().
Internal function.
ctx | The CoAP context |
now | Current time |
Definition at line 1879 of file net.c.
unsigned int coap_io_prepare_epoll | ( | coap_context_t * | ctx, |
coap_tick_t | now | ||
) |
Any now timed out delayed packet is transmitted, along with any packets associated with requested observable response.
In addition, it returns when the next expected I/O is expected to take place (e.g. a packet retransmit).
Note: If epoll support is compiled into libcoap, coap_io_prepare_epoll() must be used instead of coap_io_prepare_io().
Internal function.
ctx | The CoAP context |
now | Current time. |
Definition at line 1073 of file coap_io.c.
unsigned int coap_io_prepare_io | ( | coap_context_t * | ctx, |
coap_socket_t * | sockets[], | ||
unsigned int | max_sockets, | ||
unsigned int * | num_sockets, | ||
coap_tick_t | now | ||
) |
Iterates through all the coap_socket_t structures embedded in endpoints or sessions associated with the ctx
to determine which are wanting any read, write, accept or connect I/O (COAP_SOCKET_WANT_xxx is set).
If set, the coap_socket_t is added to the sockets
.
Any now timed out delayed packet is transmitted, along with any packets associated with requested observable response.
In addition, it returns when the next expected I/O is expected to take place (e.g. a packet retransmit).
Prior to calling coap_io_do_io(), the sockets
must be tested to see if any of the COAP_SOCKET_WANT_xxx have the appropriate information and if so, COAP_SOCKET_CAN_xxx is set. This typically will be done after using a select() call.
Note: If epoll support is compiled into libcoap, coap_io_prepare_epoll() must be used instead of coap_io_prepare_io().
Internal function.
ctx | The CoAP context |
sockets | Array of socket descriptors, filled on output |
max_sockets | Size of socket array. |
num_sockets | Pointer to the number of valid entries in the socket arrays on output. |
now | Current time. |
Definition at line 1125 of file coap_io.c.