Disable packet grouping in an attempt to increase reliability.
This commit is contained in:
parent
8f961c9d4e
commit
911f08d52c
@ -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,23 +22,10 @@ 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()
|
||||||
{
|
{
|
||||||
if ( !closed )
|
if ( !closed )
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user