using System; using System.Collections.Generic; using System.Linq; using System.Net; using System.Text; using Hammock.Retries; namespace Pithos.Network { class TimeoutRetryCondition:RetryResultCondition { public override Predicate RetryIf { get { return r => { var responseStatus = r.ResponseHttpStatusCode; if (r.Exception == null) return false; if (!(r.Exception is WebException)) return false; var exceptionStatus = ((WebException) r.Exception).Status; return (r.Exception != null && (exceptionStatus == WebExceptionStatus.Timeout)); }; } } } }