Bug 37857 - WebRequest Time out
Summary: WebRequest Time out
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2016-01-21 01:02 UTC by Paresh
Modified: 2018-03-13 11:07 UTC (History)
7 users (show)

Is this bug a regression?: ---
Last known good build:

Timeout (89.24 KB, image/png)
2016-01-21 01:02 UTC, Paresh

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Paresh 2016-01-21 01:02:00 UTC
Created attachment 14647 [details]

Our Client App retrieves documents from SharePoint server. When we hit a document URL that does not exist the Request times out. Besides this we do not have any other issues and it works fine on Windows. This timeout issue has been reproduced using HttpClient, WebRequest, and RestSharp (this internally uses WebRequest) APIs. 

 at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00046] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System/System.Net/HttpWebRequest.cs:940 
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in /private/tmp/source-mono-mac-4.2.0-branch/bockbuild-mono-4.2.0-branch/profiles/mono-mac-xamarin/build-root/mono-4.2.1/mcs/class/System/System.Net/HttpWebRequest.cs:958 
  at RestSharp.Http.GetRawResponse (System.Net.HttpWebRequest request) [0x00002] in <filename unknown>:0 

Xamarin Studio
Version 5.10.1 (build 6)
Installation UUID: 6a7bbb45-a541-440e-81e7-e1bad476a27e
	Mono 4.2.1 (explicit/6dd2d0d)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 402010102

Not Installed

Apple Developer Tools
Xcode 7.2 (9548)
Build 7C68

Not Installed

Not Installed

Xamarin Android Player
Not Installed

Version: (Business Edition)

Build Information
Release ID: 510010006
Git revision: 0b60eecdb531933734519c13257d16a780274aab
Build date: 2015-12-04 20:28:20-05
Xamarin addins: 9876fd7c9837977178411ec7375b4352c0a0d6af
Build lane: monodevelop-lion-cycle6-baseline

Operating System
Mac OS X 10.11.2
Darwin Pareshs-Mac-mini.local 15.2.0 Darwin Kernel Version 15.2.0
    Fri Nov 13 19:56:56 PST 2015
    root:xnu-3248.20.55~2/RELEASE_X86_64 x86_64
Comment 1 Chris Hamons 2016-01-21 15:05:15 UTC
System.Net.HttpWebRequest and friends are all BCL classes. Moving to the correct product.
Comment 2 Marek Safar 2016-01-28 12:39:20 UTC
Could you help us and provide some way to reproduce the issue?
Comment 3 Paresh 2016-02-04 00:48:53 UTC
Please use either client HttpRequest to download a file successfully. Remove the file or change the request Url so it cannot find that file. You should receive a time out. Please let me know if you need more information.
Comment 4 Marek Safar 2016-02-11 11:35:59 UTC
I don't. Trying with simple repro everything works

using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

class X
	public static void Main ()
		TestDownload ().Wait ();

	static async Task TestDownload ()
		var c = new HttpClient ();
		var stream = await c.GetStreamAsync ("https://github.com/mono/mono/blob/master/acceptance-tests/Makefile.am-missing");
		await stream.CopyToAsync (new MemoryStream ());

Fails as expected with

System.AggregateException: One or more errors occurred. ---> System.Net.Http.HttpRequestException: 404 (Not Found)
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode ()
Comment 5 Paresh 2016-02-16 22:38:25 UTC
Hi Marek, We are certainly seeing time out issues. You are getting AggregateException. Could you please list all the Exceptions? Could you also try non async call?

Thank you!
Comment 6 Marek Safar 2016-02-29 14:15:43 UTC
That's the only exception I get.

What non-async call? HttpClient supports only async methods.
Comment 7 Marek Safar 2018-03-13 11:07:09 UTC
We have not received the requested information. If you are still experiencing this issue please provide all the requested information and reopen the bug report.

Thank you!