Skip to content

Commit

Permalink
Remove the AIO transport as NIO is just faster
Browse files Browse the repository at this point in the history
The AIO transport was added in the past as we hoped it would have better latency as the NIO transport. But in reality this was never the case.
So there is no reason to use the AIO transport at all. It just put more burden on us as we need to also support it and fix bugs.
Because of this we dedicided to remove it for now. It will stay in the master_with_aio_transport branch so we can pick it up later again if it is ever needed.
  • Loading branch information
Norman Maurer committed Jun 10, 2013
1 parent 65e4161 commit e9c6406
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 2,281 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,41 +20,28 @@
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.Channel;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.aio.AioEventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.oio.OioEventLoopGroup;
import io.netty.channel.socket.InternetProtocolFamily;
import io.netty.channel.socket.aio.AioServerSocketChannel;
import io.netty.channel.socket.aio.AioSocketChannel;
import io.netty.channel.socket.nio.NioDatagramChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.channel.socket.oio.OioDatagramChannel;
import io.netty.channel.socket.oio.OioServerSocketChannel;
import io.netty.channel.socket.oio.OioSocketChannel;
import io.netty.util.concurrent.DefaultThreadFactory;
import io.netty.util.internal.PlatformDependent;

import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;

final class SocketTestPermutation {

// TODO: AIO transport tests fail with 'An existing connection was forcibly closed by the remote host' on Windows.
// Disabling test until the root cause is known.
private static final boolean TEST_AIO = !PlatformDependent.isWindows();

private static final int BOSSES = 2;
private static final int WORKERS = 3;
private static final EventLoopGroup nioBossGroup =
new NioEventLoopGroup(BOSSES, new DefaultThreadFactory("testsuite-nio-boss", true));
private static final EventLoopGroup nioWorkerGroup =
new NioEventLoopGroup(WORKERS, new DefaultThreadFactory("testsuite-nio-worker", true));
private static final EventLoopGroup aioBossGroup =
new AioEventLoopGroup(BOSSES, new DefaultThreadFactory("testsuite-aio-boss", true));
private static final EventLoopGroup aioWorkerGroup =
new AioEventLoopGroup(WORKERS, new DefaultThreadFactory("testsuite-aio-worker", true));
private static final EventLoopGroup oioBossGroup =
new OioEventLoopGroup(Integer.MAX_VALUE, new DefaultThreadFactory("testsuite-oio-boss", true));
private static final EventLoopGroup oioWorkerGroup =
Expand Down Expand Up @@ -168,15 +155,6 @@ public ServerBootstrap newInstance() {
.channel(NioServerSocketChannel.class);
}
});
if (TEST_AIO) {
list.add(new Factory<ServerBootstrap>() {
@Override
public ServerBootstrap newInstance() {
return new ServerBootstrap().group(aioBossGroup, aioWorkerGroup)
.channel(AioServerSocketChannel.class);
}
});
}
list.add(new Factory<ServerBootstrap>() {
@Override
public ServerBootstrap newInstance() {
Expand All @@ -196,14 +174,6 @@ public Bootstrap newInstance() {
return new Bootstrap().group(nioWorkerGroup).channel(NioSocketChannel.class);
}
});
if (TEST_AIO) {
list.add(new Factory<Bootstrap>() {
@Override
public Bootstrap newInstance() {
return new Bootstrap().group(aioWorkerGroup).channel(AioSocketChannel.class);
}
});
}
list.add(new Factory<Bootstrap>() {
@Override
public Bootstrap newInstance() {
Expand Down
168 changes: 0 additions & 168 deletions transport/src/main/java/io/netty/channel/aio/AbstractAioChannel.java

This file was deleted.

120 changes: 0 additions & 120 deletions transport/src/main/java/io/netty/channel/aio/AioCompletionHandler.java

This file was deleted.

1 comment on commit e9c6406

@yulewei
Copy link

@yulewei yulewei commented on e9c6406 Oct 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIO.2 support #2515

Please sign in to comment.