dotnet / MQTTnet

MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker). The implementation is based on the documentation from http://mqtt.org/.
MIT License
4.51k stars 1.07k forks source link

MQTTnet 3.0.10 websocket incomplete data #926

Closed pigwing closed 4 years ago

pigwing commented 4 years ago

Describe the bug

when i upgrade server to 3.0.10. i am use mqtt.js for websocket mqtt client.but it unable to receive complete data

bug related to

  1. upgrade 3.0.10 this version of MQTTnet server.
  2. websocket crash it unable to receive complete data.
  3. 3.0.9 version is ok

Screenshots

1

2

3

4

OomJan commented 4 years ago

Have the same problem using WebSockets (Remote host closed the connection) but with the client. In v3.0.9 this works fine, in 3.0.10 it does not.

pigwing commented 4 years ago

@OomJan same to you, i have WebSockets (Remote host closed the connection) and more

chkr1011 commented 4 years ago

@JanEggers Could you please have a look? Maybe I broke something accidentally...

chkr1011 commented 4 years ago

@pigwing @OomJan Do you have some more information about the environment? I tried the client and connected with broker.mqttdashboard.com:8000/mqtt without issues when using web socket connection. I also tried to connect with a local running standalone MQTTnet.Server which also works fine with web socket transport layer.

chkr1011 commented 4 years ago

@pigwing Or do you use the standalone MQTTnet.Server?

pigwing commented 4 years ago

@chkr1011 i am use MQTTnet.AspNetCore

pigwing commented 4 years ago

@chkr1011 problems still exist in MQTTnet.AspNetCore

pigwing commented 4 years ago

@chkr1011 in MQTTnet.AspNetCore the method UseMqttEndpoint is obsolete, and you fix MQTTnet.Server like it

pigwing commented 4 years ago

@chkr1011 hi, i have found the problem, it is in subscribe behavior, when i have many subscribe topic, the problem in

for(var i=0;i<1000;i++){mqtt_client.subscribe(i.toString(), { qos: 0 });}

but i change to array param

var array = []; for(var i=0;i<1000;i++){array.push(i.toString());};mqtt_client.subscribe(array, { qos: 0 });

it is ok

pigwing commented 4 years ago

when i have many subscribe topic, it will easy to trigger this problem

OomJan commented 4 years ago

MQTTnet 3.0.11 solves the problem for me.

SeppPenner commented 4 years ago

@pigwing Is this solved for you as well (in 3.0.11)?

pigwing commented 4 years ago

@SeppPenner no,in 3.0.12-rc1 solved

SeppPenner commented 4 years ago

Ok, that's good :) So we can close this issue? I don't know when the next release will come, to be honest.