下面列出了怎么用io.netty.channel.nio.NioEventLoop的API类实例代码及写法,或者点击链接到github查看源代码。
static boolean mustChunkFileTransfer(Connection c, Path file) {
// if channel multiplexing a parent channel as an http2 stream
if (c.channel().parent() != null && c.channel().parent().pipeline().get(Http2ConnectionHandler.class) != null) {
return true;
}
ChannelPipeline p = c.channel().pipeline();
return p.get(SslHandler.class) != null ||
p.get(NettyPipeline.CompressionHandler) != null ||
(!(c.channel().eventLoop() instanceof NioEventLoop) &&
!"file".equals(file.toUri().getScheme()));
}
@Override
protected boolean isCompatible(EventLoop loop) {
return loop instanceof NioEventLoop;
}
@Override
protected boolean isCompatible(EventLoop loop) {
return loop instanceof NioEventLoop;
}