Beispiel #1
0
        /// <summary>
        /// 获取到调用中心代理实例
        /// </summary>
        /// <param name="callCenterUrl"></param>
        /// <returns></returns>
        public static CallCenterProxy GetInstance(String callCenterUrl)
        {
            if (m_InstanceDict.ContainsKey(callCenterUrl))
                return m_InstanceDict[callCenterUrl];

            //if (m_Instance != null) return m_Instance;

            //--此处可以降低第一次调用的时间:2~3秒减少到200ms左右
            HttpWebRequest.DefaultWebProxy = null;
            //HttpWebRequest.DefaultCachePolicy = null;

            //--客户端的连接数
            //--http://www.cnblogs.com/summer_adai/archive/2013/04/26/3045274.html
            ServicePointManager.DefaultConnectionLimit = 10000;

            //--创建客户端代理
            //String ccUri = ConfigurationManager.AppSettings["MB.SOA.CallCenterUri"];
            CallCenterProxy proxy;
            lock (m_InstanceDict)
            {
                if (m_InstanceDict.ContainsKey(callCenterUrl))
                    proxy = m_InstanceDict[callCenterUrl];
                else
                {
                    proxy = new CallCenterProxy(callCenterUrl);
                    m_InstanceDict[callCenterUrl] = proxy;
                }
            }

            return proxy;
        }
Beispiel #2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataport"></param>
        public CallCenterAgent(DataPortBase dataport)
            : base(dataport)
        {
            m_CallCenterProxy = CallCenterProxy.GetInstance("");

            //--设置超时为10分钟
            m_CallCenterProxy.Timeout = 60 * 1000 * 10;
        }
Beispiel #3
0
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataport"></param>
        public CallCenterAgent(DataPortBase dataport)
            : base(dataport)
        {
            m_CallCenterProxy = CallCenterProxy.GetInstance("");

            //--设置超时为10分钟
            m_CallCenterProxy.Timeout = 60 * 1000 * 10;
        }
Beispiel #4
0
        /// <summary>
        /// 获取到调用中心代理实例
        /// </summary>
        /// <param name="callCenterUrl"></param>
        /// <returns></returns>
        public static CallCenterProxy GetInstance(String callCenterUrl)
        {
            if (m_InstanceDict.ContainsKey(callCenterUrl))
            {
                return(m_InstanceDict[callCenterUrl]);
            }

            //if (m_Instance != null) return m_Instance;

            //--此处可以降低第一次调用的时间:2~3秒减少到200ms左右
            HttpWebRequest.DefaultWebProxy = null;
            //HttpWebRequest.DefaultCachePolicy = null;

            //--客户端的连接数
            //--http://www.cnblogs.com/summer_adai/archive/2013/04/26/3045274.html
            ServicePointManager.DefaultConnectionLimit = 10000;

            //--创建客户端代理
            //String ccUri = ConfigurationManager.AppSettings["MB.SOA.CallCenterUri"];
            CallCenterProxy proxy;

            lock (m_InstanceDict)
            {
                if (m_InstanceDict.ContainsKey(callCenterUrl))
                {
                    proxy = m_InstanceDict[callCenterUrl];
                }
                else
                {
                    proxy = new CallCenterProxy(callCenterUrl);
                    m_InstanceDict[callCenterUrl] = proxy;
                }
            }

            return(proxy);
        }