示例#1
0
        private void SendProxyLogon()
        {
            ProxyConnection      proxyConnection = this.proxyConnections.Current;
            OutboundProxySession session         = (OutboundProxySession)this.Context.User;

            proxyConnection.ProxyWebSession.SendProxyLogon(proxyConnection.BaseUri, session, new Action <HttpStatusCode>(this.ProxyLogonResponseReceived), new Action <Exception>(this.ProxyLogonFailed));
        }
示例#2
0
 private IEnumerable <ProxyConnection> GetProxyConnections()
 {
     foreach (Uri uri in this.serviceUrlProxyQueue)
     {
         ProxyConnection connection = this.GetProxyConnection(uri);
         if (connection.IsCompatible)
         {
             yield return(connection);
         }
     }
     yield break;
 }
示例#3
0
 private void SendProxyRequest(ProxyConnection proxyConnection)
 {
     try
     {
         if (proxyConnection.IsCompatible && proxyConnection.IsAlive)
         {
             proxyConnection.ProxyWebSession.SendProxyRequest(this.Context, new Action(this.ProxyCallSucceeded), new Action <HttpContext, HttpWebResponse, Exception>(this.ProxyCallFailed));
         }
         else
         {
             this.TryNextServer();
         }
     }
     catch (Exception exception)
     {
         base.Complete(exception, false);
     }
 }
示例#4
0
        private void TryNextServer()
        {
            this.canSendProxyLogon = true;
            if (!this.proxyConnections.MoveNext())
            {
                this.AllServersFailed = true;
                base.Complete(null, false);
                return;
            }
            ProxyConnection proxyConnection = this.proxyConnections.Current;

            if (proxyConnection.IsAlive)
            {
                this.SendProxyRequest(proxyConnection);
                return;
            }
            proxyConnection.Ping(new Action <ProxyConnection>(this.SendProxyRequest));
        }