Closed jpmzometa closed 6 years ago
"an UNSUBSCRIBE without a payload" means an UNSUBSCRIBE without TopicId? This UNSUBSCRIBE is not a complete MQTT-SN packet, right? If it is true, emq-sn would be confused of the incoming packet and false-interpret this packet and next packet. If fortunate enough, it can recover from such an error.
Yes, it is an invalid/incomplete packet. The problem is that the gateway immediately loses/closes the connection with the client (but without an DISCONNECT acknowledgement).
MQTT-SN spec does not state how to handle an invalid packet. But MQTT spec has addressed that
Unless stated otherwise, if either the Server or Client encounters a protocol violation, it MUST close the Network Connection on which it received that Control Packet which caused the protocol violation.
So it is reasonable to close connection without a notification in this case.
What do you think about it?
I think it's fine. I wasn't sure if that was the intended behaviour or some kind of internal problem in the plugin. Thanks for the clarification.
Due to an error, a connected client sent an UNSUBSCRIBE without a payload to the MQTT-SN gateway. I notice that the client is disconnected immediately after without any notification.