public IAsyncResult BeginGetResponse(AsyncCallback callback, object state) { AsyncResult<WebResponse> asyncResult = new AsyncResult<WebResponse>(callback, state); ThreadPool.QueueUserWorkItem(_ => asyncResult.Finish(GetResponse(), false)); return asyncResult; }
public IAsyncResult BeginGetRequestStream(AsyncCallback callback, object state) { AsyncResult<Stream> asyncResult = new AsyncResult<Stream>(callback, state); ThreadPool.QueueUserWorkItem(_ => asyncResult.Finish(new MemoryStream(), false)); return asyncResult; }