Replies: 1 comment 2 replies
-
You should ask this under the esp-mbedtls repo. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I use
esp-mbedtls
withmqtt
(usingembassy
for async) and need to continuously listen to messages and from time to time send messages.Do I need to stop the listening in order to send messages? Might I miss messages due to that?
As a compilation test, I tried to use embassy-futures select as follows:
select(self.tls.read(&mut buf), self.tls.write_all(&buf2));
(where tls is
AsyncConnectedSession
)I obviously get the following error:
Even if it did work, I would want to architecturally separate the handling of incoming messages from outgoing messages.
What's the best way to do that?
The only option I could think of is to create an embassy task for the 'technical' work, that communicates with other business logic tasks through two queues (incoming, outgoing), receives messages and send the mqtt messages w/o any processing, and internally, when it is requested to send a message, it stops listening and continues after message was sent.
Is that the proper way to handle that? Am I at risk of missing incoming messages that way or will the incoming traffic stored, including if its mid processing of partial data when I stop awaiting to switch to send, and all messages will arrive eventually (up to internal buffers size of course)?
Beta Was this translation helpful? Give feedback.
All reactions