问题
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