public void start() {
        //线程池
        if (executor == null) {
            executor = Executors.newFixedThreadPool(threadPoolSize);
        }
        ChannelFactory channelFactory = new NioServerSocketChannelFactory(executor, executor);
        //ChannelFactory channelFactory = new NioServerSocketChannelFactory(
        //Executors.newCachedThreadPool(), Executors.newCachedThreadPool());
        ServerBootstrap serverBootstrap = new ServerBootstrap(channelFactory);
        serverBootstrap.setPipelineFactory(new NettyServerChannelPipleFactory(this));

        //启动
        InetSocketAddress localAddress;
        //设置邦定地址
        if (addr != null) {
            localAddress = new InetSocketAddress(addr, port);
        } else {
            localAddress = new InetSocketAddress(port);
        }
        //绑定地址
        serverBootstrap.bind(localAddress);
    }