Java 类io.netty.channel.nio.AbstractNioByteChannel 实例源码

项目:netty4.0.27Learn    文件:DefaultChannelConfig.java   
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;
    }
}
项目:netty4study    文件:DefaultChannelConfig.java   
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;
    }
}
项目:netty-netty-5.0.0.Alpha1    文件:DefaultChannelConfig.java   
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;
    }
}