public override WebResponse EndGetResponse (IAsyncResult ar)
{
HttpWebAsyncResult async_result = ar as HttpWebAsyncResult;
if (async_result == null)
throw new ArgumentException ("asyncResult");
try {
if (!async_result.IsCompleted)
async_result.AsyncWaitHandle.WaitOne ();
if (async_result.HasException)
throw async_result.Exception;
try {
return new ClientHttpWebResponse (this, response);
}
catch (TargetInvocationException tie) {
throw tie.InnerException;
}
}
finally {
async_result.Dispose ();
}
}
}