diff --git a/transport/src/main/java/io/netty/channel/socket/aio/AioSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/aio/AioSocketChannel.java index 8451ba3a33..f474288bf7 100755 --- a/transport/src/main/java/io/netty/channel/socket/aio/AioSocketChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/aio/AioSocketChannel.java @@ -180,9 +180,9 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne @Override public void completed(Integer result, AioSocketChannel channel) { - ByteBuf buf = channel.pipeline().outboundByteBuffer(); - + ByteBuf buf = channel.unsafe().directOutboundContext().outboundByteBuffer(); if (result > 0) { + // Update the readerIndex with the amount of read bytes buf.readerIndex(buf.readerIndex() + result);