eclipse / paho.mqtt.java

Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
2.08k stars 879 forks source link

decode receiveMaximum use readShort cause the problem #1006

Open ymhh opened 1 year ago

ymhh commented 1 year ago

when send only one message to broker,there is error as follow。 正在进行过多的发布 (32202) at org.eclipse.paho.mqttv5.client.internal.ClientState.send(ClientState.java:544) at org.eclipse.paho.mqttv5.client.internal.ClientComms.internalSend(ClientComms.java:155) at org.eclipse.paho.mqttv5.client.internal.ClientComms.sendNoWait(ClientComms.java:218) at org.eclipse.paho.mqttv5.client.MqttAsyncClient.publish(MqttAsyncClient.java:1530) at org.eclipse.paho.mqttv5.client.MqttAsyncClient.publish(MqttAsyncClient.java:1499)

the reason is the server return receiveMaximum as 65535, and MqttProperties#decodeProperties use readShort to read value ,the result is -1, so cause the problem。 shoule use readUnsignShort instead to read receiveMaximum value