Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

receive and send packet separate thread #310

Open
skyfishyubo opened this issue Oct 31, 2024 · 2 comments
Open

receive and send packet separate thread #310

skyfishyubo opened this issue Oct 31, 2024 · 2 comments

Comments

@skyfishyubo
Copy link

receiveSingleIteration have handleKeepAlive function. could we relealize a non-static handleKeepAlive function so that could be call in TX thread, in this way we could sleep for wait to receive message, and have different thread to handle the keepalive issue.

@ActoryOu
Copy link
Member

Hi @skyfishyubo,
Thank you for your suggestion about separating receiveSingleIteration and handleKeepAlive. Could you please elaborate on the benefits you see in this approach? We're interested in understanding your perspective to better evaluate this potential change. Your insights would be greatly appreciated.

Thank you.

@archigup
Copy link
Member

archigup commented Nov 1, 2024

Hey, if you use MQTT_ProcessLoop, it handles keep-alives. You can instead use MQTT_ReceiveLoop, which doesn't handle keep-alives, allowing you to handle them yourself. You could then send them on another thread on a schedule, or however else you would like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants