private readonly Uri uri;
private Stream inputStream;
private MemoryStream outputStream = new MemoryStream();
- private int connectTimeout = 0;
- private int readTimeout = 0;
+
+ // Timeouts in milliseconds
+ private int connectTimeout = 30000;
+
+ private int readTimeout = 30000;
+
private IDictionary<String, String> customHeaders = new Dictionary<string, string>();
+ private HttpWebRequest connection = null;
+ private IWebProxy proxy = WebRequest.DefaultWebProxy;
+
public THttpClient(Uri u)
{
uri = u;
+ connection = CreateRequest();
}
public int ConnectTimeout
}
}
+ public IWebProxy Proxy
+ {
+ set
+ {
+ proxy = value;
+ }
+ }
+
public override bool IsOpen
{
get
}
#if !SILVERLIGHT
- connection.Proxy = null;
+ connection.Proxy = proxy;
#endif
return connection;