Statistics
| Branch: | Revision:

root / trunk / hammock / src / net35 / Hammock / Retries / ConnectionClosed.cs @ 0eea575a

History | View | Annotate | Download (595 Bytes)

1
using System;
2
using System.Net;
3

    
4
namespace Hammock.Retries
5
{
6
#if !SILVERLIGHT
7
    [Serializable]
8
#endif
9
    public class ConnectionClosed : RetryErrorCondition
10
    {
11
        public override Predicate<Exception> RetryIf
12
        {
13
            get
14
            {
15
                return e =>
16
                           {
17
                               var we = e as WebException;
18
                               return we != null && (we.Status == WebExceptionStatus.ConnectionClosed || we.Status == WebExceptionStatus.KeepAliveFailure);
19
                           };
20
            }
21
        }
22
    }
23
}