If receive a client disconnect pack:
1.Then need to break the read packet loop before next loop start, to avoid a IO error.
2.To clear will msg, according to MQTT 3.1.1: "The Will Message MUST be published when the Network Connection is subsequently closed unless the Will Message has been deleted by the Server on receipt of a DISCONNECT Packet".
If receive a client disconnect pack: 1.Then need to break the read packet loop before next loop start, to avoid a IO error. 2.To clear will msg, according to MQTT 3.1.1: "The Will Message MUST be published when the Network Connection is subsequently closed unless the Will Message has been deleted by the Server on receipt of a DISCONNECT Packet".