Eclipse paho Mqtt:Getting java.io.EOF Exception

↘锁芯ラ 提交于 2019-12-06 01:22:19

You have multiple clients connecting to the broker with the same clientid, this is not allowed and as one connects the broker will disconnect the currently connected client.

If both clients have automatic reconnection logic then they will just continue to kick each other off.

Change the client id on one of the clients.

As hardillb mentioned above, you have multiple clients connecting. Server (mosquitto) will disconnect the old connection when it receives a connect request from the same client again.

use the isConnected() method on MqttClient object to know if its connected. for eg.

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