I am creating a Windows service that runs several subordinate processes. In each of these subordinate processes, I start listening to the named pipe for the message from the main process.
I currently have a situation where a master process calls a slave on 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 falls into CommunicationState.Faulted, and any subsequent calls on the channel also do not work.
What can I do to check with the master that the slave process is being tapped? Or how do I recover from CommunicationState.Faultedto redo my deleted call?