moscajs / mosca

MQTT broker as a module
mosca.io
3.2k stars 513 forks source link

Used paho.client.mqttv3 as client,and the server just can recieve one message. #692

Open xiaoshouchen opened 6 years ago

xiaoshouchen commented 6 years ago

I used paho.client.mqttv as client on Android ,and I send many message to server powerd by mosca ,and it just can recieve one message,if I continue publishing message,the server cant log it. and if I use mqtt.js as client ,it will be ok,and can recieve message normally

xiaoshouchen commented 6 years ago

its confusing,I cant resolute it,can someone help me。and if I use mosquito as server,It can work normally too。 the java code is here private void initMqttConnectionOptions(String paramString1, String paramString2) { this.conOpt = new MqttConnectOptions(); this.conOpt.setCleanSession(true); this.conOpt.setUserName(paramString1); this.conOpt.setPassword(paramString2.toCharArray()); this.conOpt.setConnectionTimeout(10); this.conOpt.setKeepAliveInterval(20); } publish method this.client.publish(paramString, paramArrayOfByte, 2, false);