Skip to content

Commit c5715e3

Browse files
diopoexPaul HöhnDakshitBabbaractions-user
authored
Express the need of a non-blocking TransportRecv_t (#318)
Express the need of a non-blocking TransportRecv_t #317 Description ----------- - changed documentation to express the need of a non-blocking TransportRecv_t - mentioned that a non-blocking implementation is highly recommended in porting.dox and in the transportinterface - did go more into detail in TransportRecv_t what the effects of a blocking recv implementation are Test Steps ----------- only changed documentation Checklist: ---------- <!--- Go over all the following points, and put an `x` in all the boxes that apply. --> <!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> - [ ] I have tested my changes. No regression in existing tests. - [ ] I have modified and/or added unit-tests to cover the code changes in this Pull Request. Related Issue ----------- #317 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. --------- Co-authored-by: Paul Höhn <[email protected]> Co-authored-by: DakshitBabbar <[email protected]> Co-authored-by: GitHub Action <[email protected]> Co-authored-by: DakshitBabbar <[email protected]>
1 parent 8ec72d6 commit c5715e3

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

docs/doxygen/porting.dox

+2
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ struct NetworkContext {
5555
};
5656
@endcode
5757

58+
Please note that it is HIGHLY RECOMMENDED that the transport receive implementation does NOT block.
59+
5860
@section mqtt_porting_time Time Function
5961
@brief The MQTT library relies on a function to generate millisecond timestamps, for the
6062
purpose of calculating durations and timeouts, as well as maintaining the keep-alive mechanism

source/interface/transport_interface.h

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
* without TLS, it is typically implemented by calling the TCP layer receive
9797
* function. @ref TransportRecv_t may be invoked multiple times by the protocol
9898
* library, if fewer bytes than were requested to receive are returned.
99+
* Please note that it is HIGHLY RECOMMENDED that the transport receive implementation does NOT block.
99100
* <br><br>
100101
* <b>Example code:</b>
101102
* @code{c}
@@ -200,6 +201,9 @@ typedef struct NetworkContext NetworkContext_t;
200201
* coreMQTT will continue to call the transport interface if it receives
201202
* a partial packet until it accumulates enough data to get the complete
202203
* MQTT packet.
204+
* A non‐blocking implementation is also essential so that the library's inbuilt
205+
* keep‐alive mechanism can work properly, given the user chooses to use
206+
* that over their own keep alive mechanism.
203207
*
204208
* @param[in] pNetworkContext Implementation-defined network context.
205209
* @param[in] pBuffer Buffer to receive the data into.

0 commit comments

Comments
 (0)