root / trunk / Pithos.Network / docs / timeoutretrycondition.html @ 1caef52e
History | View | Annotate | Download (2.3 kB)
1 | 1caef52e | Panagiotis Kanavos | <!DOCTYPE html />
|
---|---|---|---|
2 | 1caef52e | Panagiotis Kanavos | |
3 | 1caef52e | Panagiotis Kanavos | <html>
|
4 | 1caef52e | Panagiotis Kanavos | <head>
|
5 | 1caef52e | Panagiotis Kanavos | <title>TimeoutRetryCondition.cs</title> |
6 | 1caef52e | Panagiotis Kanavos | <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
7 | 1caef52e | Panagiotis Kanavos | <link href="focco.css" rel="stylesheet" media="all" type="text/css" /> |
8 | 1caef52e | Panagiotis Kanavos | <script src="prettify.js" type="text/javascript"></script> |
9 | 1caef52e | Panagiotis Kanavos | </head>
|
10 | 1caef52e | Panagiotis Kanavos | <body onload="prettyPrint()"> |
11 | 1caef52e | Panagiotis Kanavos | <div id="container"> |
12 | 1caef52e | Panagiotis Kanavos | <div id="background"></div> |
13 | 1caef52e | Panagiotis Kanavos | <div id="jump_to"> |
14 | 1caef52e | Panagiotis Kanavos | Jump To …
|
15 | 1caef52e | Panagiotis Kanavos | <div id="jump_wrapper"> |
16 | 1caef52e | Panagiotis Kanavos | <div id="jump_page"> |
17 | 1caef52e | Panagiotis Kanavos | <a class="source" href="cloudfilesclient.html"> |
18 | 1caef52e | Panagiotis Kanavos | CloudFilesClient.cs |
19 | 1caef52e | Panagiotis Kanavos | </a>
|
20 | 1caef52e | Panagiotis Kanavos | <a class="source" href="restclient.html"> |
21 | 1caef52e | Panagiotis Kanavos | RestClient.cs |
22 | 1caef52e | Panagiotis Kanavos | </a>
|
23 | 1caef52e | Panagiotis Kanavos | <a class="source" href="timeoutretrycondition.html"> |
24 | 1caef52e | Panagiotis Kanavos | TimeoutRetryCondition.cs |
25 | 1caef52e | Panagiotis Kanavos | </a>
|
26 | 1caef52e | Panagiotis Kanavos | <a class="source" href="properties/assemblyinfo.html"> |
27 | 1caef52e | Panagiotis Kanavos | Properties\AssemblyInfo.cs |
28 | 1caef52e | Panagiotis Kanavos | </a>
|
29 | 1caef52e | Panagiotis Kanavos | </div>
|
30 | 1caef52e | Panagiotis Kanavos | </div>
|
31 | 1caef52e | Panagiotis Kanavos | </div>
|
32 | 1caef52e | Panagiotis Kanavos | <table cellpadding="0" cellspacing="0"> |
33 | 1caef52e | Panagiotis Kanavos | <thead>
|
34 | 1caef52e | Panagiotis Kanavos | <tr>
|
35 | 1caef52e | Panagiotis Kanavos | <th class="docs"> |
36 | 1caef52e | Panagiotis Kanavos | <h1>TimeoutRetryCondition.cs</h1> |
37 | 1caef52e | Panagiotis Kanavos | </th>
|
38 | 1caef52e | Panagiotis Kanavos | <th class="code"></th> |
39 | 1caef52e | Panagiotis Kanavos | </tr>
|
40 | 1caef52e | Panagiotis Kanavos | </thead>
|
41 | 1caef52e | Panagiotis Kanavos | <tbody>
|
42 | 1caef52e | Panagiotis Kanavos | <tr id="section_1"> |
43 | 1caef52e | Panagiotis Kanavos | <td class="docs"> |
44 | 1caef52e | Panagiotis Kanavos | <div class="pilwrap"> |
45 | 1caef52e | Panagiotis Kanavos | <a class="pilcrow" href="#section_1">¶</a> |
46 | 1caef52e | Panagiotis Kanavos | </div>
|
47 | 1caef52e | Panagiotis Kanavos | |
48 | 1caef52e | Panagiotis Kanavos | </td>
|
49 | 1caef52e | Panagiotis Kanavos | <td class="code"> |
50 | 1caef52e | Panagiotis Kanavos | <pre><code class='prettyprint'>using System; |
51 | 1caef52e | Panagiotis Kanavos | using System.Collections.Generic; |
52 | 1caef52e | Panagiotis Kanavos | using System.Linq; |
53 | 1caef52e | Panagiotis Kanavos | using System.Net; |
54 | 1caef52e | Panagiotis Kanavos | using System.Text; |
55 | 1caef52e | Panagiotis Kanavos | using Hammock.Retries; |
56 | 1caef52e | Panagiotis Kanavos | |
57 | 1caef52e | Panagiotis Kanavos | namespace Pithos.Network |
58 | 1caef52e | Panagiotis Kanavos | { |
59 | 1caef52e | Panagiotis Kanavos | class TimeoutRetryCondition:RetryResultCondition |
60 | 1caef52e | Panagiotis Kanavos | { |
61 | 1caef52e | Panagiotis Kanavos | public override Predicate<Hammock.Web.WebQueryResult> RetryIf |
62 | 1caef52e | Panagiotis Kanavos | { |
63 | 1caef52e | Panagiotis Kanavos | get |
64 | 1caef52e | Panagiotis Kanavos | { |
65 | 1caef52e | Panagiotis Kanavos | return r =>
|
66 | 1caef52e | Panagiotis Kanavos | { |
67 | 1caef52e | Panagiotis Kanavos | var responseStatus = r.ResponseHttpStatusCode; |
68 | 1caef52e | Panagiotis Kanavos | if (r.Exception == null) |
69 | 1caef52e | Panagiotis Kanavos | return false; |
70 | 1caef52e | Panagiotis Kanavos | if (!(r.Exception is WebException)) |
71 | 1caef52e | Panagiotis Kanavos | return false; |
72 | 1caef52e | Panagiotis Kanavos | var exceptionStatus = ((WebException) r.Exception).Status; |
73 | 1caef52e | Panagiotis Kanavos | return (r.Exception != null |
74 | 1caef52e | Panagiotis Kanavos | && (exceptionStatus == WebExceptionStatus.Timeout)); |
75 | 1caef52e | Panagiotis Kanavos | }; |
76 | 1caef52e | Panagiotis Kanavos | } |
77 | 1caef52e | Panagiotis Kanavos | } |
78 | 1caef52e | Panagiotis Kanavos | } |
79 | 1caef52e | Panagiotis Kanavos | } |
80 | 1caef52e | Panagiotis Kanavos | </code></pre> |
81 | 1caef52e | Panagiotis Kanavos | </td>
|
82 | 1caef52e | Panagiotis Kanavos | </tr>
|
83 | 1caef52e | Panagiotis Kanavos | </tbody>
|
84 | 1caef52e | Panagiotis Kanavos | </table>
|
85 | 1caef52e | Panagiotis Kanavos | </div>
|
86 | 1caef52e | Panagiotis Kanavos | </body>
|
87 | 1caef52e | Panagiotis Kanavos | </html> |