Skip to content

Instantly share code, notes, and snippets.

@peteraritchie
Created April 30, 2012 12:00
Show Gist options
  • Save peteraritchie/2557661 to your computer and use it in GitHub Desktop.
Save peteraritchie/2557661 to your computer and use it in GitHub Desktop.
sequential asynchronous
HttpWebRequest req = (HttpWebRequest) WebRequest.Create("http://contoso.com");
req.BeginGetResponse(result =>
{
var response = req.EndGetResponse(result);
req = (HttpWebRequest)WebRequest.Create("http://example.com");
req.BeginGetResponse(result2 =>
{
response = req.EndGetResponse(result2);
req = (HttpWebRequest)WebRequest.Create("http://example.com");
}, null);
}, null);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment