5
我正在啓動公開WCF端點的子進程。我如何從子進程向父進程發出信號,告知子進程已完全初始化,並且現在可以訪問端點?向父進程發信號表明子進程已完全初始化
我曾考慮過使用信號量達到這個目的,但不能完全弄清楚如何實現所需的信號。
string pipeUri = "net.pipe://localhost/Node0";
ProcessStartInfo startInfo = new ProcessStartInfo("Node.exe", "-uri=" + pipeUri);
Process p = Process.Start(startInfo);
NetNamedPipeBinding binding = new NetNamedPipeBinding();
var channelFactory = new ChannelFactory<INodeController>(binding);
INodeController controller = channelFactory.CreateChannel(new EndpointAddress(pipeUri));
// need some form of signal here to avoid..
controller.Ping() // EndpointNotFoundException!!