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

Reusing client between connections #402

Open
denravonska opened this issue May 23, 2024 · 2 comments
Open

Reusing client between connections #402

denravonska opened this issue May 23, 2024 · 2 comments
Assignees

Comments

@denravonska
Copy link

We have a use case where we want to reuse the MqttClient object between connects to avoid destroying semaphores that may be accessed by other FreeRTOS tasks. However, it seems like the client keeps internal states that would be cleared by memset during MqttClient_Init.

Q: Is the library supposed to support client reuse or are you supposed to initialize a new one on connect?

Q: Would you be interested in a MqttClient_Reset PR that handles all the internal clearing?

@embhorn embhorn self-assigned this May 23, 2024
@embhorn
Copy link
Member

embhorn commented May 23, 2024

Hello @denravonska

Thanks for your interest in the wolfMQTT project!

Q: Is the library supposed to support client reuse or are you supposed to initialize a new one on connect?

Yes, the library currently expects a fresh client structure prior to calling connect.

Q: Would you be interested in a MqttClient_Reset PR that handles all the internal clearing?

Certainly! That is a use case we had not considered. In order to accept any code changes, you will need to be an approved contributor. You can start this process by emailing support@wolfssl.com and referencing this issue. Otherwise, you can open feature request for this functionality by emailing the same address.

Thanks,
@embhorn - wolfSSL Support

@denravonska
Copy link
Author

Alrighty, I can start having a look while I wait for the process.

The base case will be trivial but I expect to fail spectacularly on the v5 and SN parts as I'm not familiar with those areas of the library, nor am I sure how I'll test it with those features.

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

No branches or pull requests

2 participants