Skip to content

Commit

Permalink
nrf_modem: doc: update NRF_SO_RCVTIMEO for accept
Browse files Browse the repository at this point in the history
The NRF_SO_RCVTIMEO is used to set the timeout in accept.

Signed-off-by: Eivind Jølsgard <[email protected]>
  • Loading branch information
eivindj-nordic committed Feb 23, 2024
1 parent 18ca70b commit b47de7e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions nrf_modem/doc/sockets/socket_options_func.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The following table shows all socket options supported by the Modem library.
+-----------------+---------------------------------+------------------------+------------+--------------------------------------------------------------------------------------------+
| NRF_SOL_SOCKET | NRF_SO_REUSEADDR | ``int`` | set | Non-zero requests reuse of local addresses in :c:func:`nrf_bind` (protocol-specific). |
+-----------------+---------------------------------+------------------------+------------+--------------------------------------------------------------------------------------------+
| NRF_SOL_SOCKET | NRF_SO_RCVTIMEO | ``struct nrf_timeval`` | get/set | Timeout value for a socket receive operation. |
| NRF_SOL_SOCKET | NRF_SO_RCVTIMEO | ``struct nrf_timeval`` | get/set | Timeout value for a socket receive and accept operations. |
+-----------------+---------------------------------+------------------------+------------+--------------------------------------------------------------------------------------------+
| NRF_SOL_SOCKET | NRF_SO_SNDTIMEO | ``struct nrf_timeval`` | get/set | Timeout value for a socket send operation. |
+-----------------+---------------------------------+------------------------+------------+--------------------------------------------------------------------------------------------+
Expand Down Expand Up @@ -111,10 +111,11 @@ NRF_SO_REUSEADDR
The default value for :c:macro:`NRF_SO_REUSEADDR` is ``off``, that is, reuse of local addresses is not permitted.

NRF_SO_RCVTIMEO
Set a timeout value for the :c:func:`nrf_recv` and :c:func:`nrf_recvfrom` operations.
Set a timeout value for the :c:func:`nrf_recv`, :c:func:`nrf_recvfrom` and :c:func:`nrf_accept` operations.
This option accepts an :c:struct:`nrf_timeval` structure with a number of seconds and microseconds specifying the limit on how long to wait for an input operation to complete.
If a receive operation has blocked for this much time without receiving additional data, it returns with a partial count, or ``errno`` is set to :c:macro:`NRF_EAGAIN` or :c:macro:`NRF_EWOULDBLOCK` if no data were received.
The default for this option is the value ``0``, which indicates that a receive operation will not time out.
If an accept operation has blocked for this much time without receiving an incoming connection, it returns ``-1`` and ``errno`` is set to :c:macro:`NRF_EAGAIN`.
The default for this option is the value ``0``, which indicates that a receive or accept operation will not time out.

.. note::
The minimum supported resolution is 1 millisecond.
Expand Down

0 comments on commit b47de7e

Please sign in to comment.