本文整理汇总了Java中io.netty.channel.nio.AbstractNioByteChannel类的典型用法代码示例。如果您正苦于以下问题:Java AbstractNioByteChannel类的具体用法?Java AbstractNioByteChannel怎么用?Java AbstractNioByteChannel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractNioByteChannel类属于io.netty.channel.nio包,在下文中一共展示了AbstractNioByteChannel类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultChannelConfig
import io.netty.channel.nio.AbstractNioByteChannel; //导入依赖的package包/类
public DefaultChannelConfig(Channel channel) {
if (channel == null) {
throw new NullPointerException("channel");
}
this.channel = channel;
if (channel instanceof ServerChannel || channel instanceof AbstractNioByteChannel) {
// Server channels: Accept as many incoming connections as possible.
// NIO byte channels: Implemented to reduce unnecessary system calls even if it's > 1.
// See https://github.com/netty/netty/issues/2079
// TODO: Add some property to ChannelMetadata so we can remove the ugly instanceof
maxMessagesPerRead = 16;
} else {
maxMessagesPerRead = 1;
}
}