Use childGroup for accepted AioSocketChannels, children of previously bound AioServerSocketChannel.
This commit is contained in:
parent
06fd869711
commit
148e629104
@ -40,6 +40,7 @@ public class AioServerSocketChannel extends AbstractAioChannel implements Server
|
|||||||
private static final InternalLogger logger =
|
private static final InternalLogger logger =
|
||||||
InternalLoggerFactory.getInstance(AioServerSocketChannel.class);
|
InternalLoggerFactory.getInstance(AioServerSocketChannel.class);
|
||||||
|
|
||||||
|
private final AioEventLoopGroup childGroup;
|
||||||
private final AioServerSocketChannelConfig config;
|
private final AioServerSocketChannelConfig config;
|
||||||
private boolean closed;
|
private boolean closed;
|
||||||
private AtomicBoolean readSuspended = new AtomicBoolean();
|
private AtomicBoolean readSuspended = new AtomicBoolean();
|
||||||
@ -60,9 +61,14 @@ public class AioServerSocketChannel extends AbstractAioChannel implements Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public AioServerSocketChannel(AioEventLoopGroup eventLoop) {
|
public AioServerSocketChannel(AioEventLoopGroup group) {
|
||||||
super(null, null, eventLoop, newSocket(eventLoop.group));
|
this(group, group);
|
||||||
config = new AioServerSocketChannelConfig(javaChannel());
|
}
|
||||||
|
|
||||||
|
public AioServerSocketChannel(AioEventLoopGroup parentGroup, AioEventLoopGroup childGroup) {
|
||||||
|
super(null, null, parentGroup, newSocket(parentGroup.group));
|
||||||
|
this.childGroup = childGroup;
|
||||||
|
this.config = new AioServerSocketChannelConfig(javaChannel());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -147,7 +153,7 @@ public class AioServerSocketChannel extends AbstractAioChannel implements Server
|
|||||||
|
|
||||||
// create the socket add it to the buffer and fire the event
|
// create the socket add it to the buffer and fire the event
|
||||||
channel.pipeline().inboundMessageBuffer().add(
|
channel.pipeline().inboundMessageBuffer().add(
|
||||||
new AioSocketChannel(channel, null, channel.group, ch));
|
new AioSocketChannel(channel, null, channel.childGroup, ch));
|
||||||
if (!channel.readSuspended.get()) {
|
if (!channel.readSuspended.get()) {
|
||||||
channel.pipeline().fireInboundBufferUpdated();
|
channel.pipeline().fireInboundBufferUpdated();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user