Fixed the issue 204, forcing flush at each write insted of wait for the Channel to be flushed

This commit is contained in:
andsel
2016-09-27 22:35:16 +02:00
parent 912a88ec0a
commit cf67d5ac52
2 changed files with 118 additions and 1 deletions
@@ -571,10 +571,12 @@ public class ProtocolProcessor {
Channel channel = m_clientIDs.get(clientId).channel;
LOG.trace("Session for clientId {}", clientId);
if (channel.isWritable()) {
LOG.debug("channel is writable");
//if channel is writable don't enqueue
channel.write(pubMessage);
channel.writeAndFlush(pubMessage);
} else {
//enqueue to the client session
LOG.debug("enqueue to client session");
clientsession.enqueue(pubMessage);
}
}