namespace System.Net.Http
{
- public class HttpClient : HttpMessageInvoker
+ public partial class HttpClient : HttpMessageInvoker
{
static readonly TimeSpan TimeoutDefault = TimeSpan.FromSeconds (100);
long buffer_size;
TimeSpan timeout;
+#if !XAMARIN_MODERN
public HttpClient ()
: this (new HttpClientHandler (), true)
{
}
+#endif
public HttpClient (HttpMessageHandler handler)
: this (handler, true)
return timeout;
}
set {
- if (value != System.Threading.Timeout.InfiniteTimeSpan && value < TimeSpan.Zero)
+ if (value != System.Threading.Timeout.InfiniteTimeSpan && (value <= TimeSpan.Zero || value.Ticks > int.MaxValue))
throw new ArgumentOutOfRangeException ();
timeout = value;