java.io.EOFException with paho

后端 未结 7 1470
慢半拍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.

提交回复
热议问题