Fixing PubRelEncoder to encode PubRel message flag to match what is in the MQTT specification http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718054
This commit is contained in:
@@ -28,7 +28,7 @@ class PubRelEncoder extends DemuxEncoder<PubRelMessage> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void encode(ChannelHandlerContext chc, PubRelMessage msg, ByteBuf out) {
|
protected void encode(ChannelHandlerContext chc, PubRelMessage msg, ByteBuf out) {
|
||||||
out.writeByte(AbstractMessage.PUBREL << 4);
|
out.writeByte(AbstractMessage.PUBREL << 4 | 0x02);
|
||||||
out.writeBytes(Utils.encodeRemainingLength(2));
|
out.writeBytes(Utils.encodeRemainingLength(2));
|
||||||
out.writeShort(msg.getMessageID());
|
out.writeShort(msg.getMessageID());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user