Disable packet grouping in an attempt to increase reliability.

This commit is contained in:
md_5 2013-07-31 20:18:54 +10:00
parent 8f961c9d4e
commit 911f08d52c
2 changed files with 1 additions and 17 deletions

View File

@ -12,7 +12,6 @@ public class ChannelWrapper
private final Channel ch; private final Channel ch;
@Getter @Getter
private volatile boolean closed; private volatile boolean closed;
private boolean flushNow = true;
public ChannelWrapper(ChannelHandlerContext ctx) public ChannelWrapper(ChannelHandlerContext ctx)
{ {
@ -23,22 +22,9 @@ public class ChannelWrapper
{ {
if ( !closed ) if ( !closed )
{ {
ch.write( packet ); ch.writeAndFlush( packet );
if ( flushNow )
{
ch.flush();
} }
} }
}
public synchronized void flushNow(boolean flush)
{
if ( !flushNow && flush )
{
ch.flush();
}
this.flushNow = flush;
}
public synchronized void close() public synchronized void close()
{ {

View File

@ -69,7 +69,6 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
@Override @Override
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception public void channelReadComplete(ChannelHandlerContext ctx) throws Exception
{ {
channel.flushNow( false );
while ( !msgs.isEmpty() ) while ( !msgs.isEmpty() )
{ {
Object msg = msgs.remove(); Object msg = msgs.remove();
@ -95,7 +94,6 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
} }
} }
} }
channel.flushNow( true );
} }
@Override @Override