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.
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.
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();
If I do this the channel gets into CommunicationState.Faulted
and any subsequent calls on the channel fail as well.
What can I do to verify from the master that the slave process starts listening? Or how can I recover from the CommunicationState.Faulted
to retry my remote call?