public void startSync() throws DistributeCommonException {
        status = Status.STARTING;
        if (channel == null) {
            if (channelFactory == null) {
                Executor executor = Executors.newFixedThreadPool(6);
                channelFactory = new NioClientSocketChannelFactory(executor, executor);
            }
            ClientBootstrap clientBootstrap = new ClientBootstrap(channelFactory);
            //设置处理链
            clientBootstrap.setPipelineFactory(new NettyClientChannelPipleFactory(this));
            //进行连接
            ChannelFuture future = clientBootstrap.connect(new InetSocketAddress(addr, port));
            //同步工具
            final CountDownLatch countDownLatch = new CountDownLatch(1);

            future.addListener(new ChannelFutureListener() {

                @Override
                public void operationComplete(ChannelFuture f) throws Exception {
                    if (!f.isSuccess()) {
                        status = Status.STOPPED;

                        throw new NetException(f.getCause(), "连接[" + addr + ":" + port + "]失败");
                    } else {
                        //设置channel
                        channel = f.getChannel();
                        System.out.println("连接成功");
                    }
                    countDownLatch.countDown();
                }
            });

            //等待连接完成
            try {
                countDownLatch.await(10 * 1000, TimeUnit.MILLISECONDS);
            } catch (InterruptedException e) {
                status = Status.STOPPED;
                throw new DistributeCommonException(e);
            }

        } else if (!channel.isConnected()) {
            //重新连接一下
            //channel.connect(new InetSocketAddress(addr, port));
            status = Status.STOPPED;
            throw new DistributeCommonException("无法启动关闭的连接");
        }

        status = Status.RUNNING;
    }