Closed monstrenyatko closed 7 years ago
Hi @tarzan115
This improvement is related to your problem (#12). Could you please try and let me know.
Hi @gjt211
The latest changes should allow you to have very quick loop
iterations.
Just call the MqttClient::yield
with 0
or any other small enough value for you and
set the NET_MIN_TM_MS
to something very small using MqttClient
constructor. The default value of the NET_MIN_TM_MS
is 10
ms.
hi @monstrenyatko
I have tested with NET_MIN_TM_MS = 10
and NET_MIN_TM_MS = 1
in a few days. and it works fine 😃
thank you so much for that ❤️
Hi @tarzan115 Great! I'll prepare the new release. Thank you for the confirmation!
When no data available to receive or it is not a time to send
keep alive
message, etc...yield
still consumes a lot of time due to theNET_MIN_TM_MS
value (see #12 discussion). TheNET_MIN_TM_MS
was introduced to guaranty reception of the entire message by singlerecvPacket
call.Solution:
NET_MIN_TM_MS
value configurable, see #12NET_MIN_TM_MS
to something small like10
or1
msread
execution byNET_MIN_TM_MS
value each time when something receivedRisks: May increase the number of disconnections in case of bad network connection because the library still needs to receive the entire message while single
yield
call.