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 f474288bf7..08deb6f66f 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 @@ -108,8 +108,15 @@ public class AioSocketChannel extends AbstractAioChannel implements SocketChanne if (ch == null) { ch = AsynchronousSocketChannel.open(AsynchronousChannelGroup.withThreadPool(eventLoop())); config = new AioSocketChannelConfig(javaChannel()); + return null; } else if (remoteAddress() != null) { - read(); + return new Runnable() { + + @Override + public void run() { + read(); + } + }; } return null; }