static void Main(string[] args) { // Making a request to a nonexistent domain. HttpSocket.MakeRequest(new Uri("http://www.tanzaniatouristboard.com/"), callbackState => { if (callbackState.RequestTimedOut) { Console.WriteLine("Timed out!"); } else if (callbackState.Exception != null) { throw callbackState.Exception; } else { Console.WriteLine(GetResponseText(callbackState.ResponseStream)); } }); Thread.Sleep(100000); }