示例#1
0
文件: ESBProxy.cs 项目: rebider/soa
        public static ESBProxy GetInstance()
        {
            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;

            //--创建客户端代理
            ESBProxy proxy = new ESBProxy();

            Interlocked.CompareExchange <ESBProxy>(ref m_Instance, proxy, null);

            //--初始化客户端代理
            proxy.Init();

            return(m_Instance);
        }
示例#2
0
文件: ESBProxy.cs 项目: BiYiTuan/soa
        public static ESBProxy GetInstance()
        {
            if (m_Instance != null)
            {
                return(m_Instance);
            }

            ESBProxy proxy = new ESBProxy();

            Interlocked.CompareExchange <ESBProxy>(ref m_Instance, proxy, null);

            return(m_Instance);
        }
示例#3
0
文件: ESBProxy.cs 项目: vebin/soa
        public static ESBProxy GetInstance()
        {
            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;

            //--创建客户端代理
            ESBProxy proxy = new ESBProxy();
            Interlocked.CompareExchange<ESBProxy>(ref m_Instance, proxy, null);

            //--初始化客户端代理
            proxy.Init();

            return m_Instance;
        }