Introduced handling of sessionPresent flag in ConnAck msg, now on every conenction is created an empty subscription in ISessionStore

This commit is contained in:
selva.andre
2014-07-27 12:20:53 +02:00
parent bd3c4cb40c
commit 482ffe0c65
8 changed files with 70 additions and 5 deletions
@@ -30,7 +30,7 @@ class ConnAckEncoder extends DemuxEncoder<ConnAckMessage>{
protected void encode(ChannelHandlerContext chc, ConnAckMessage message, ByteBuf out) {
out.writeByte(AbstractMessage.CONNACK << 4);
out.writeBytes(Utils.encodeRemainingLength(2));
out.writeByte(0);
out.writeByte(message.isSessionPresent() ? 0x01 : 0x00);
out.writeByte(message.getReturnCode());
}