title: How can I check that a WCF host is available before I use a channel from a client?
body: <p>I am creating a windows service that starts a number of slave processes. In each of these slave process I start listening on a named pipe for message from the master process. </p>
  
  <p>I currently have the situation where the master process calls a slave via a named pipe before the slave is fully started and starts listening on the named pipe.</p>
  
  <pre><code>    ProcessStartInfo processStartInfo = new ProcessStartInfo("slave");
      processStartInfo.Arguments = Address 
  
      Process process = new Process();
      process.StartInfo = processStartInfo;
  
      process.Start();
  
      base.Endpoint.Binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
      base.Endpoint.Address = Address;
  
      base.Channel.RemoteMethod();
  </code></pre>
  
  <p>If I do this the channel gets into <code>CommunicationState.Faulted</code> and any subsequent calls on the channel fail as well.</p>
  
  <p>What can I do to verify from the master that the slave process starts listening? Or how can I recover from the <code>CommunicationState.Faulted</code> to retry my remote call?</p>