![]() |
nrfxlib API 3.3.99
|
| #define NRF_SO_SEC_DTLS_CONN_SAVE 17 |
#include <nrf_modem/include/nrf_socket.h>
Save DTLS connection (Write-only).
You can use this socket option to pause a session that is not frequently used by the application. Saving the session frees up memory in the modem (the modem serializes and compresses the socket). This frees up memory that can be used for other connections.
If the socket is closed, the saved DTLS data is cleaned, and the connection with the server is lost.
This option requires a DTLS v1.2 connection with renegotiation disabled.
After the socket option is successfully called, you must call NRF_SO_SEC_DTLS_CONN_LOAD before continuing to communicate on the socket.
This option can fail with different errno values:
| errno | Condition | Notes |
|---|---|---|
NRF_EAGAIN | Error during SSL context serialization. | The SSL context is still present |
| This can happen if the modem cannot | in the socket, so data sending | |
| allocate enough memory or if the socket | is still possible. | |
| is busy sending or receiving data. | ||
NRF_EINVAL | The socket option is not supported | Examples: DTLS handshake not |
| with the current configuration. | completed; connection is not a | |
| DTLS 1.2 connection with | ||
| renegotiation disabled; or | ||
| connection does not use an AEAD | ||
| cipher suite (AES-CCM or AES-GCM). | ||
NRF_ENOMEM | The number of saved connections | |
| exceeds four. |