diff --git a/nrf_modem/doc/sockets/pdn.rst b/nrf_modem/doc/sockets/pdn.rst index f589249e4d..5375c4721b 100644 --- a/nrf_modem/doc/sockets/pdn.rst +++ b/nrf_modem/doc/sockets/pdn.rst @@ -54,9 +54,18 @@ Handling PDN errors on sockets ****************************** During operation, an active PDN connection may be deactivated due to loss of connectivity or other reasons. + +The following applies to sockets that have set the :c:macro:`NRF_SO_KEEPOPEN` socket option: + +The loss of an active PDN connection will not result in errors. +Socket operations can return errors due to lack of PDN connectivity. +Upon PDN reactivation, the socket is functional and can resume its operations. +The application is responsible for detecting and re-attempting operations that fail while the socket does not have an active PDN. + +The following applies to sockets that have not set the :c:macro:`NRF_SO_KEEPOPEN` socket option: + 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``. 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``. The socket error can be retrieved using the :c:macro:`NRF_SO_ERROR` socket option. - When the ``NRF_ENETDOWN`` error is detected, the socket is no longer usable and must be closed by the application. The application is responsible for detecting when the PDN connection is activated again, before re-creating the socket and attempting the failed operation again.