CSharpTradeOffers.Web.Web.RetryRequestProcessor C# (CSharp) Method

RetryRequestProcessor() private method

Processes retry attempts
private RetryRequestProcessor ( int retryWait, int retryLimit, string url, string method, string>.Dictionary data = null, CookieContainer cookies = null, bool xHeaders = true, string referer = "", bool isWebkit = false ) : IResponse
retryWait int
retryLimit int
url string
method string
data string>.Dictionary
cookies System.Net.CookieContainer
xHeaders bool
referer string
isWebkit bool
return IResponse
        private IResponse RetryRequestProcessor(int retryWait, int retryLimit, string url, string method,
            Dictionary<string, string> data = null,
            CookieContainer cookies = null, bool xHeaders = true, string referer = "", bool isWebkit = false)
        {
            int attempts = 0;
            while (true)
            {
                try
                {
                    return _webRequestHandler.HandleWebRequest(url, method, data, cookies, xHeaders, referer, isWebkit);
                }
                catch (WebException we)
                {
                    HttpWebResponse response = we.Response as HttpWebResponse;;
                    switch (we.Status)
                    {
                        case WebExceptionStatus.SendFailure:
                            break;
                        case WebExceptionStatus.ConnectFailure:
                            break;
                        case WebExceptionStatus.ConnectionClosed:
                            break;
                        case WebExceptionStatus.ReceiveFailure:
                            break;
                        case WebExceptionStatus.Timeout:
                            break;
                        case WebExceptionStatus.ProtocolError:
                            break;
                        default:
                            if (response?.StatusCode == HttpStatusCode.NotFound)
                                return null;
                            throw;
                    }
                    if (attempts >= retryLimit)
                        return null;
                    attempts++;
                }

                Thread.Sleep(retryWait);
            }
        }