/// <summary>
        /// 创建客户端。
        /// </summary>
        /// <param name="endPoint">终结点。</param>
        /// <returns>传输客户端实例。</returns>
        public ITransportClient CreateClient(EndPoint endPoint)
        {
            var key = endPoint;

            if (_logger.IsEnabled(LogLevel.Debug))
            {
                _logger.LogDebug($"准备为服务端地址:{key}创建客户端。");
            }
            try
            {
                return(_clients.GetOrAdd(key
                                         , k => new Lazy <ITransportClient>(() =>
                {
                    var bootstrap = _bootstrap;
                    var channel = bootstrap.ConnectAsync(k).Result;

                    var messageListener = new MessageListener();
                    channel.GetAttribute(messageListenerKey).Set(messageListener);
                    var messageSender = new DotNettyMessageClientSender(_transportMessageEncoder, channel);
                    channel.GetAttribute(messageSenderKey).Set(messageSender);
                    channel.GetAttribute(origEndPointKey).Set(k);

                    var client = new TransportClient(messageSender, messageListener, _logger, _serviceExecutor);
                    return client;
                }
                                                                            )).Value);
            }
            catch
            {
                _clients.TryRemove(key, out var value);
                throw;
            }
        }
        /// <summary>
        /// 创建客户端。
        /// </summary>
        /// <param name="endPoint">终结点。</param>
        /// <returns>传输客户端实例。</returns>
        public async Task <ITransportClient> CreateClientAsync(EndPoint endPoint)
        {
            var key = endPoint;

            if (_logger.IsEnabled(LogLevel.Debug))
            {
                _logger.LogDebug($"准备为服务端地址:{key}创建客户端。");
            }
            try
            {
                return(await _clients.GetOrAdd(key, k => new Lazy <Task <ITransportClient> >(async() =>
                {
                    // 客户端对象
                    var bootstrap = _bootstrap;
                    // 异步连接返回channel
                    var channel = await bootstrap.ConnectAsync(k);
                    var messageListener = new MessageListener();
                    // 设置监听
                    channel.GetAttribute(messageListenerKey).Set(messageListener);
                    // 实例化发送者
                    var messageSender = new DotNettyMessageClientSender(_transportMessageEncoder, channel);
                    // 设置channel属性
                    channel.GetAttribute(messageSenderKey).Set(messageSender);
                    channel.GetAttribute(origEndPointKey).Set(k);
                    // 创建客户端
                    var client = new TransportClient(messageSender, messageListener, _logger, _serviceExecutor);
                    return client;
                })).Value);
            }
            catch
            {
                _clients.TryRemove(key, out var value);
                throw;
            }
        }