System.Net.Browser.BrowserHttpWebRequestInternal.EndGetResponse C# (CSharp) Method

EndGetResponse() public method

public EndGetResponse ( IAsyncResult asyncResult ) : WebResponse
asyncResult IAsyncResult
return WebResponse
		public override WebResponse EndGetResponse (IAsyncResult asyncResult)
		{
			try {
				if (async_result != asyncResult)
					throw new ArgumentException ("asyncResult");

				if (aborted) {
					NativeMethods.http_request_abort (native);
					throw new WebException ("Aborted", WebExceptionStatus.RequestCanceled);
				}

				if (!async_result.IsCompleted)
					async_result.AsyncWaitHandle.WaitOne ();

				if (async_result.HasException) {
					throw async_result.Exception;
				}

				response = async_result.Response as BrowserHttpWebResponse;
			}
			finally {
				async_result.Dispose ();
				managed.Free ();
			}

			return response;
		}