Q:

Check if ServiceHost is alive

I have a NetNamedPipeBinding with a bool isAlive() method with which i want to check if the ServiceHost is alive.
Currently this looks like this:
 while (!stopThread)
        {
            Thread.Sleep(1000); 
            try{
              try
              {
                 pipeproxy.isAlive();
              }
              catch (CommunicationObjectFaultedException)
              {
                 pipeproxy = pipeFactory.CreateChannel();
              }
            }                
            catch (EndpointNotFoundException)
            {

               //Show notification
                  stopThread=true;
            }
            catch{}
        }
   //Close Application

Surprisingly i can create a Channel even though there is no host, so I'm not sure whether this is the correct approach or not.
Thanks in advance.

A:

CreateChannel does not connect to the service, this only happens when you call it. 

