java.io.EOFException with paho

后端 未结 7 1392
慢半拍i
慢半拍i 2021-02-09 11:23

i want to make stress test on mosquitto, so i create some code as below

for (int i = 0; i < 800; i++) {
        final int j = i;
        Thread t = new Thread         


        
相关标签:
7条回答
  • 2021-02-09 12:20

    The solution is add MqttClient.generateClientId

    MemoryPersistence persistence = new MemoryPersistence()
    MqttClient client = new MqttClient("tcp://192.168.88.203",MqttClient.generateClientId(),persistence); 
    client.connect();
    

    or

    MqttClient client = new MqttClient("tcp://192.168.88.203", MqttClient.generateClientId+SERVER_CLIENTID_PREFIX)
    

    The identifier must be random. I had this problem in scala and that was my solution.

    0 讨论(0)
提交回复
热议问题