shamblett / mqtt5_client

A server and browser based MQTT 5 client for dart
Other
50 stars 26 forks source link

Clear messageStream when disconnect #29

Closed iRusher closed 2 years ago

iRusher commented 2 years ago

MqttConnectionHandlerBase::sendMessage - sending message started >>> -> MQTTMessage of type MqttMessageType.connect ... MqttServerConnection::_onData - Message Received Started <<< MqttServerConnection::_ondata - adding incoming data, data length is 13, message stream length is 147571, message stream position is 0

Message stream still cached bytes when client auto reconnect. Incoming connect ack message will be appended after stream and cannot be decoded normally. Do messageStream.shrink() when disconnect occur works for me. Large message data may cause this case.