Use different EventLoopGroup for AIO transport tests

- plus tiny cleanup
This commit is contained in:
Trustin Lee 2012-08-17 12:18:00 +09:00
parent 0a99a33540
commit 9c17304755
2 changed files with 6 additions and 5 deletions

View File

@ -54,10 +54,11 @@ final class SocketTestPermutation {
sbfs.add(new Factory<ServerBootstrap>() { sbfs.add(new Factory<ServerBootstrap>() {
@Override @Override
public ServerBootstrap newInstance() { public ServerBootstrap newInstance() {
AioEventLoopGroup loop = new AioEventLoopGroup(); AioEventLoopGroup parentGroup = new AioEventLoopGroup();
AioEventLoopGroup childGroup = new AioEventLoopGroup();
return new ServerBootstrap(). return new ServerBootstrap().
group(loop). group(parentGroup, childGroup).
channel(new AioServerSocketChannel(loop)); channel(new AioServerSocketChannel(parentGroup, childGroup));
} }
}); });
sbfs.add(new Factory<ServerBootstrap>() { sbfs.add(new Factory<ServerBootstrap>() {

View File

@ -43,7 +43,7 @@ public class AioServerSocketChannel extends AbstractAioChannel implements Server
private final AioEventLoopGroup childGroup; private final AioEventLoopGroup childGroup;
private final AioServerSocketChannelConfig config; private final AioServerSocketChannelConfig config;
private boolean closed; private boolean closed;
private AtomicBoolean readSuspended = new AtomicBoolean(); private final AtomicBoolean readSuspended = new AtomicBoolean();
private final Runnable acceptTask = new Runnable() { private final Runnable acceptTask = new Runnable() {
@ -68,7 +68,7 @@ public class AioServerSocketChannel extends AbstractAioChannel implements Server
public AioServerSocketChannel(AioEventLoopGroup parentGroup, AioEventLoopGroup childGroup) { public AioServerSocketChannel(AioEventLoopGroup parentGroup, AioEventLoopGroup childGroup) {
super(null, null, parentGroup, newSocket(parentGroup.group)); super(null, null, parentGroup, newSocket(parentGroup.group));
this.childGroup = childGroup; this.childGroup = childGroup;
this.config = new AioServerSocketChannelConfig(javaChannel()); config = new AioServerSocketChannelConfig(javaChannel());
} }
@Override @Override