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:
Victor Kazakov
2015-08-24 15:10:56 -07:00
parent d8875dd8b9
commit d8e432b4cf
@@ -28,7 +28,7 @@ class PubRelEncoder extends DemuxEncoder<PubRelMessage> {
@Override
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.writeShort(msg.getMessageID());
}