Mqtt client disconnects when another client connects to the server

喜夏-厌秋 提交于 2020-06-17 09:51:27

问题


I am new to MQTT messaging system, but yet i managed to implement the paho Android service in snapdragon board running AOSP kk-4.4.2 . My service will start at the boot up and it will connect to the public broker of HiveMQ with port 1883 .

The problem is after connecting my Android device running my custom AOSP to the server and if i try to connect another client from the android application which is running on a phone. The client in the snapdragon board automatically disconnects from the server. when i try to reconnect it is connecting to the server again.

I use different client Id and user names while connecting to the server


回答1:


This is most likely because you are using the same client id for both (all) clients.

Client ids need to be unique and most brokers will disconnect the first connection when a second connects with the same id.



来源:https://stackoverflow.com/questions/61543804/mqtt-connection-connected-and-disconnected-repeatedly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!