Java 类io.netty.channel.socket.DefaultServerSocketChannelConfig 实例源码

项目:netty4study    文件:NioServerSocketChannel.java   
/**
 * Create a new instance
 */
public NioServerSocketChannel() {

    //调用父类的构造函数
    //todo:core 这里构造函数的第三个参数,是设置的NioServerSocketChannel注册的selector感兴趣的selectionkey值即属性readInterestOp
    //因为这里是ServerSocket,所以设置的是OP_ACCEPT,在调用unsafe的beginRead设置selectionKey.interestOps(interestOps |  readInterestOp);
    super(null, newSocket(), SelectionKey.OP_ACCEPT);
    config = new DefaultServerSocketChannelConfig(this, javaChannel().socket());
}
项目:netty-netty-5.0.0.Alpha1    文件:NioServerSocketChannel.java   
/**
 * Create a new instance
 */
public NioServerSocketChannel(EventLoop eventLoop, EventLoopGroup childGroup) {
    super(null, eventLoop, childGroup, newSocket(), SelectionKey.OP_ACCEPT);
    config = new DefaultServerSocketChannelConfig(this, javaChannel().socket());
}