コード例 #1
0
        // public OTSClient(string configFileName) { }
        // TODO enable client config file later

        /// <summary>
        /// 通过客户端配置<see cref="OTSClientConfig"/>的实例来创建<see cref="OTSClient"/>实例。
        /// </summary>
        /// <param name="config">客户端配置实例</param>
        public OTSClient(OTSClientConfig config)
        {
            ClientConfig = config;
            OTSHandler   = new OTSHandler();

            client             = new HttpClient();
            client.BaseAddress = new Uri(ClientConfig.EndPoint);
            ServicePointManager.DefaultConnectionLimit = config.ConnectionLimit;
            OTSClientTestHelper.Reset();
        }
コード例 #2
0
        // public OTSClient(string configFileName) { }
        // TODO enable client config file later

        /// <summary>
        /// 通过客户端配置<see cref="OTSClientConfig"/>的实例来创建<see cref="OTSClient"/>实例。
        /// </summary>
        /// <param name="config">客户端配置实例</param>
        public OTSClient(OTSClientConfig config)
        {
            ClientConfig = config;
            OTSHandler   = new OTSHandler();

            ConnectionPool = new OTSConnectionPool(
                ClientConfig.EndPoint,
                ClientConfig.ConnectionLimit
                );

            OTSClientTestHelper.Reset();
        }