i'm doing following,
var request = (HttpWebRequest)WebRequest.Create(serviceUrl);
var response = (HttpWebResponse)request.GetResponse();
if(response.StatusCode == HttpStatusCode.OK)
{
//perform some operations.
}
in order to check if the service in up and running in my asp.net c# 4.0 application. its giving me expected results but if the service is not running it is taking too much time (nearly about 1 min) to get the response.
is their any other better way to check if the service is up and running?