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

建议优化mqtt clien密码设置API接口 #74

Open
Whisky0520 opened this issue Nov 29, 2022 · 2 comments
Open

建议优化mqtt clien密码设置API接口 #74

Whisky0520 opened this issue Nov 29, 2022 · 2 comments

Comments

@Whisky0520
Copy link

您好,可爱的杰杰老师,我是一名嵌入式开发工作者,我在使用您所写的kawaii-mqtt库的时候发现一个可以优化的地方,就是在mqtt_connect_with_results()的时候MQTT密码所填充的区域是cstring。我在使用的过程中所连接的是一个第三方商用的MQTT服务器,他只支持MQTT密码格式为lenstring,就导致连接服务器不成功,最终我是改了库中MQTT密码的填充方式才连接上的,我觉的是不是可以把mqtt_set_password()接口接口分成cstring和lenstring类型。

@Ryan-CW-Code
Copy link

这个跟mqtt服务器没一点关系,很可能你的mqtt密码不是静态字符串,等到connect的时候就被释放掉了
jiejie大神最近似乎忙于琐事,没有更新clientmqtt了,
可以试试我写的RyanMqtt,有很多事件回调函数哦。 所有字符串相关的RyanMqtt库内都有重新复制一份,不会造成资源被释放产生的副作用咯

@jiejieTop
Copy link
Owner

可以的,后续可以优化一下

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