SWRU455M February 2017 – October 2020 CC3120 , CC3120MOD , CC3130 , CC3135 , CC3135MOD , CC3220MOD , CC3220MODA , CC3220R , CC3220S , CC3220SF , CC3230S , CC3230SF , CC3235MODAS , CC3235MODASF , CC3235MODS , CC3235MODSF , CC3235S , CC3235SF
By default, network bound APIs are blocking (network-bound APIs are APIs that trigger networking transactions and wait for their completion). For some implementations, especially on non-OS platforms, nonblocking operations are essential to allow other activities during these periods. For these use cases, the SimpleLink device supports the standard nonblocking method of BSD sockets, and also a proprietary mode (trigger mode). In nonblocking mode, it is the responsibility of the application to poll the relevant API until the operation is completed. However, in trigger mode, instead of polling the API, the host receives an event when the operation is completed, and only then should call the API again.
Table 7-4 describes the different modes of the relevant APIs.
API | TCP, UDP, RAW | Blocking Mode | Non-Blocking Mode | Trigger Mode |
---|---|---|---|---|
sl_Connect | TCP | Blocked until connect success, or connect time-out. | Supported. SL_ERROR_BSD_EALREADY error code means not connected yet; poll again. | Not supported |
sl_Recv/ sl_RecvFrom | TCP | Blocked until data arrives. Recv Time-out can be set by sl_SetSockOpt. | Supported. SL_ERROR_BSD_EAGAIN error code means data has not arrived; poll again. | Not supported |
UDP | ||||
RAW | ||||
sl_Send/ sl_SendTo | TCP | Blocked until the internal buffer is available. | Supported. SL_ERROR_BSD_EAGAIN error code means no internal buffer available; try to send again. | Not supported |
UDP | ||||
RAW | ||||
sl_Accept | TCP | Blocked until client connects. | Supported. SL_ERROR_BSD_EAGAIN error code means no client connection; try to accept again. | Not supported |
sl_Select | TCP | Blocked until one or more registered sockets become ready. | Supported | Supported |
UDP | ||||
RAW |