本文整理汇总了C#中System.Net.Request.GetRetryPolicy方法的典型用法代码示例。如果您正苦于以下问题:C# Request.GetRetryPolicy方法的具体用法?C# Request.GetRetryPolicy怎么用?C# Request.GetRetryPolicy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Net.Request
的用法示例。
在下文中一共展示了Request.GetRetryPolicy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogSlowRequests
/// <summary>
/// ���������ɵ���Ϣ�������ԣ�
/// </summary>
private void LogSlowRequests(long requestLifetime, Request request, byte[] responseContents, HttpStatusCode statusCode)
{
if (DEBUG || requestLifetime > SLOW_REQUEST_THRESHOLD_MS)
{
VolleyLog.D("HTTP response for request=<{0}> [lifetime={1}],[size={2}], [rc={3}],[retryCount={4}]", requestLifetime, requestLifetime,
responseContents != null ? responseContents.Length.ToString() : "null",
statusCode, request.GetRetryPolicy().CurrentRetryCount);
}
}
示例2: AttempRetryOnException
private static void AttempRetryOnException(String logPrefix, Request request, VolleyError exception)
{
IRetryPolicy retryPolicy = request.GetRetryPolicy();
int oldTimeout = request.GetTimeoutMs();
try
{
retryPolicy.Retry(exception);
}
catch (VolleyError e)
{
request.AddMarker(String.Format("{0}-timeout-giveup[timeout={1}]", logPrefix, oldTimeout));
throw e;
}
request.AddMarker(String.Format("{0}-retry [timeout-{1}]", logPrefix, oldTimeout));
}