Mqtt client disconnects when another client connects to the server

断了今生、忘了曾经 提交于 2020-11-28 03:38:44

问题


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/36184490/mqtt-client-disconnects-when-another-client-connects-to-the-server

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