Provides backend functionality for asynchronous sock access.
More...
Provides backend functionality for asynchronous sock access.
- Warning
- This feature is experimental!
This API extension is still under development and should not be used in production yet.
|
file | types.h |
| Definitions for sock extension for asynchronous access.
|
|
file | async.h |
| Definitions for sock extension for asynchronous access.
|
|
|
typedef struct sock_dtls | sock_dtls_t |
| forward declare for async
|
|
typedef void(* | sock_dtls_cb_t) (sock_dtls_t *sock, sock_async_flags_t flags, void *arg) |
| Event callback for sock_dtls_t. More...
|
|
typedef struct sock_ip | sock_ip_t |
| forward declare for async
|
|
typedef void(* | sock_ip_cb_t) (sock_ip_t *sock, sock_async_flags_t flags, void *arg) |
| Event callback for sock_ip_t. More...
|
|
typedef struct sock_tcp | sock_tcp_t |
| forward declare for async
|
|
typedef struct sock_tcp_queue | sock_tcp_queue_t |
| forward declare for async
|
|
typedef void(* | sock_tcp_cb_t) (sock_tcp_t *sock, sock_async_flags_t flags, void *arg) |
| Event callback for sock_tcp_t. More...
|
|
typedef void(* | sock_tcp_queue_cb_t) (sock_tcp_queue_t *queue, sock_async_flags_t flags, void *arg) |
| Event callback for sock_tcp_queue_t. More...
|
|
typedef struct sock_udp | sock_udp_t |
| forward declare for async
|
|
typedef void(* | sock_udp_cb_t) (sock_udp_t *sock, sock_async_flags_t type, void *arg) |
| Event callback for sock_udp_t. More...
|
|
|
void | sock_dtls_set_cb (sock_dtls_t *sock, sock_dtls_cb_t cb, void *cb_arg) |
| Gets the asynchronous event context from sock object. More...
|
|
void | sock_ip_set_cb (sock_ip_t *sock, sock_ip_cb_t cb, void *cb_arg) |
| Sets event callback for sock_ip_t. More...
|
|
void | sock_tcp_set_cb (sock_tcp_t *sock, sock_tcp_cb_t cb, void *cb_arg) |
| Sets event callback for sock_tcp_t. More...
|
|
void | sock_tcp_queue_set_cb (sock_tcp_queue_t *queue, sock_tcp_queue_cb_t cb, void *cb_arg) |
| Sets event callback for sock_tcp_queue_t. More...
|
|
void | sock_udp_set_cb (sock_udp_t *sock, sock_udp_cb_t cb, void *cb_arg) |
| Gets the asynchronous event context from sock object. More...
|
|
sock_async_ctx_t * | sock_dtls_get_async_ctx (sock_dtls_t *sock) |
| Gets the asynchronous event context from sock object. More...
|
|
sock_async_ctx_t * | sock_ip_get_async_ctx (sock_ip_t *sock) |
| Gets the asynchronous event context from sock object. More...
|
|
sock_async_ctx_t * | sock_tcp_get_async_ctx (sock_tcp_t *sock) |
| Gets the asynchronous event context from sock object. More...
|
|
sock_async_ctx_t * | sock_tcp_queue_get_async_ctx (sock_tcp_queue_t *queue) |
| Gets the asynchronous event context from TCP listening queue. More...
|
|
sock_async_ctx_t * | sock_udp_get_async_ctx (sock_udp_t *sock) |
| Gets the asynchronous event context from sock object. More...
|
|
◆ sock_dtls_cb_t
Event callback for sock_dtls_t.
- Precondition
(sock != NULL)
- Note
- Only applicable with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | The sock the event happened on |
[in] | flags | The event flags. Expected values are
|
[in] | arg | Argument provided when setting the callback using sock_dtls_set_cb(). May be NULL. |
Definition at line 68 of file types.h.
◆ sock_ip_cb_t
Event callback for sock_ip_t.
- Precondition
(sock != NULL)
- Note
- Only applicable with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | The sock the event happened on |
[in] | flags | The event flags. Expected values are
|
[in] | arg | Argument provided when setting the callback using sock_ip_set_cb(). May be NULL. |
Definition at line 91 of file types.h.
◆ sock_tcp_cb_t
Event callback for sock_tcp_t.
- Precondition
(sock != NULL)
- Note
- Only applicable with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | The sock the event happened on |
[in] | flags | The event flags. Expected values are
|
[in] | arg | Argument provided when setting the callback using sock_tcp_set_cb(). May be NULL. |
Definition at line 117 of file types.h.
◆ sock_tcp_queue_cb_t
◆ sock_udp_cb_t
Event callback for sock_udp_t.
- Precondition
(sock != NULL)
- Note
- Only applicable with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | The sock the event happened on |
[in] | flags | The event flags. Expected values are
|
[in] | arg | Argument provided when setting the callback using sock_udp_set_cb(). May be NULL. |
Definition at line 157 of file types.h.
◆ sock_async_flags_t
Flag types to signify asynchronous sock events.
- Note
- Only applicable with SOCK_HAS_ASYNC defined.
Enumerator |
---|
SOCK_ASYNC_CONN_RDY | Connection ready event.
|
SOCK_ASYNC_CONN_FIN | Connection finished event.
|
SOCK_ASYNC_CONN_RECV | Listener received connection event.
|
SOCK_ASYNC_MSG_RECV | Message received event.
|
SOCK_ASYNC_MSG_SENT | Message sent event.
|
SOCK_ASYNC_PATH_PROP | Path property changed event.
|
Definition at line 37 of file types.h.
◆ sock_dtls_get_async_ctx()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Note
- Only available with SOCK_HAS_ASYNC and SOCK_HAS_ASYNC_CTX defined.
- See also
- SOCK_HAS_ASYNC_CTX
- Parameters
-
[in] | sock | A DTLS sock object. |
- Returns
- The asynchronous event context
◆ sock_dtls_set_cb()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Warning
- Never handle the callback in the caller's context! You might block the operation of the network stack or the DTLS library with that.
- Note
- Only available with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | A DTLS sock object. |
[in] | cb | An event callback. May be NULL to unset event callback. |
[in] | cb_arg | Argument to provide to cb . May be NULL. |
◆ sock_ip_get_async_ctx()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Note
- Only available with SOCK_HAS_ASYNC and SOCK_HAS_ASYNC_CTX defined.
- See also
- SOCK_HAS_ASYNC_CTX
- Parameters
-
[in] | sock | A raw IPv4/IPv6 sock object. |
- Returns
- The asynchronous event context
◆ sock_ip_set_cb()
Sets event callback for sock_ip_t.
- Precondition
(sock != NULL)
- Warning
- Never handle the callback in the caller's context! You might block the operation of the network stack with that.
- Note
- Only available with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | A raw IPv4/IPv6 sock object. |
[in] | cb | An event callback. May be NULL to unset event callback. |
[in] | cb_arg | Argument to provide to cb . May be NULL. |
◆ sock_tcp_get_async_ctx()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Note
- Only available with SOCK_HAS_ASYNC and SOCK_HAS_ASYNC_CTX defined.
- See also
- SOCK_HAS_ASYNC_CTX
- Parameters
-
[in] | sock | A TCP sock object. |
- Returns
- The asynchronous event context
◆ sock_tcp_queue_get_async_ctx()
Gets the asynchronous event context from TCP listening queue.
- Precondition
(queue != NULL)
- Note
- Only available with SOCK_HAS_ASYNC and SOCK_HAS_ASYNC_CTX defined.
- See also
- SOCK_HAS_ASYNC_CTX
- Parameters
-
[in] | queue | A TCP listening queue. |
- Returns
- The asynchronous event context
◆ sock_tcp_queue_set_cb()
Sets event callback for sock_tcp_queue_t.
- Precondition
(sock != NULL)
- Warning
- Never handle the callback in the caller's context! You might block the operation of the network stack with that.
- Note
- Only available with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | queue | A TCP listening queue. |
[in] | cb | An event callback. May be NULL to unset event callback. |
[in] | cb_arg | Argument to provide to cb . May be NULL. |
◆ sock_tcp_set_cb()
Sets event callback for sock_tcp_t.
- Precondition
(sock != NULL)
- Warning
- Never handle the callback in the caller's context! You might block the operation of the network stack with that.
- Note
- Only available with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | A TCP sock object. |
[in] | cb | An event callback. May be NULL to unset event callback. |
[in] | cb_arg | Argument to provide to cb . May be NULL. |
◆ sock_udp_get_async_ctx()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Note
- Only available with SOCK_HAS_ASYNC and SOCK_HAS_ASYNC_CTX defined.
- See also
- SOCK_HAS_ASYNC_CTX
- Parameters
-
[in] | sock | A UDP sock object. |
- Returns
- The asynchronous event context
◆ sock_udp_set_cb()
Gets the asynchronous event context from sock object.
- Precondition
(sock != NULL)
- Warning
- Never handle the callback in the caller's context! You might block the operation of the network stack with that.
- Note
- Only available with SOCK_HAS_ASYNC defined.
- Parameters
-
[in] | sock | A UDP sock object. |
[in] | cb | An event callback. May be NULL to unset event callback. |
[in] | cb_arg | Argument to provide to cb |