@Override
    public void sendResponseSync(CommandPackage commandPackage, int timeoutms)
                                                                              throws DistributeCommonException {
        //没有在运行，不能发送
        if (!isRunning()) {
            throw new NetException("还没有启动连接,或者连接还没有完成");
        }
        //发送数据
        ChannelFuture future = channel.write(commandPackage);
        //保存发送的数据的信息
        SendingPackageInfo sendingPackageInfo = new SendingPackageInfo();
        //初始化保存的发送数据信息
        sendingPackageInfo.setChannelFuture(future);
        sendingPackageInfo.setAsync(false);
        sendingPackageInfo.setCommandPackage(commandPackage);
        sendingPackageInfo.setCountDownLatch(new CountDownLatch(1));
        //保存到请求结果处
        sendingPackages.put(future, sendingPackageInfo);
        //
        future.addListener(new ChannelFutureListener() {

            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
                SendingPackageInfo packageInfo = sendingPackages.get(future);
                if (packageInfo == null) {
                    return;
                }
                if (future.isSuccess()) {
                    packageInfo.setSuccess(true);
                } else {
                    packageInfo.setSuccess(false);
                    packageInfo.setCause(future.getCause());
                }
            }
        });

        //等待超时
        try {
            sendingPackageInfo.getCountDownLatch().await(timeoutms, TimeUnit.MILLISECONDS);
        } catch (InterruptedException e) {
            //throw new DistributeCommonException(e);
            ;
        }
        //查看结果
        sendingPackageInfo = sendingPackages.get(future);
        if (sendingPackageInfo == null) {
            throw new DistributeCommonException("无法获取package信息");
        }
        //
        if (!sendingPackageInfo.isSuccess()) {
            //超时
            if (sendingPackageInfo.getCause() == null) {
                throw new NetTimeoutException("发送报文[" + commandPackage + "]超时");
            }
            //本系统异常
            else if (sendingPackageInfo.getCause() instanceof DistributeCommonException) {
                throw (DistributeCommonException) sendingPackageInfo.getCause();
            }
            //其他异常，包裹一下
            else {
                throw new DistributeCommonException(sendingPackageInfo.getCause());
            }
        }
    }