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)); }
private IEnumerable <ProxyConnection> GetProxyConnections() { foreach (Uri uri in this.serviceUrlProxyQueue) { ProxyConnection connection = this.GetProxyConnection(uri); if (connection.IsCompatible) { yield return(connection); } } yield break; }
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); } }
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)); }