Skip to content

Commit 37e2ac2

Browse files
eivindj-nordicanangl
authored andcommitted
nrf_modem: doc: add info about PDN down when NRF_SO_KEEPOPEN is used
Add info about PDN down events when NRF_SO_KEEPOPEN is used. Signed-off-by: Eivind Jølsgard <[email protected]>
1 parent 490cea2 commit 37e2ac2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

nrf_modem/doc/sockets/pdn.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,18 @@ Handling PDN errors on sockets
5454
******************************
5555

5656
During operation, an active PDN connection may be deactivated due to loss of connectivity or other reasons.
57+
58+
The following applies to sockets that have set the :c:macro:`NRF_SO_KEEPOPEN` socket option:
59+
60+
The loss of an active PDN connection will not result in errors.
61+
Socket operations can return errors due to lack of PDN connectivity.
62+
Upon PDN reactivation, the socket is functional and can resume its operations.
63+
The application is responsible for detecting and re-attempting operations that fail while the socket does not have an active PDN.
64+
65+
The following applies to sockets that have not set the :c:macro:`NRF_SO_KEEPOPEN` socket option:
66+
5767
When a socket operation is attempted on a socket that no longer has an active PDN connection, the operation will return ``-1`` and set ``errno`` to ``NRF_ENETDOWN``.
5868
If the socket is being polled, the :c:func:`nrf_poll` function will set the ``POLLERR`` flag and set the socket error to ``NRF_ENETDOWN``.
5969
The socket error can be retrieved using the :c:macro:`NRF_SO_ERROR` socket option.
60-
6170
When the ``NRF_ENETDOWN`` error is detected, the socket is no longer usable and must be closed by the application.
6271
The application is responsible for detecting when the PDN connection is activated again, before re-creating the socket and attempting the failed operation again.

0 commit comments

Comments
 (0)