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