c# - Signalling to a parent process that a child process is fully initialised -


i'm launching child process exposes wcf endpoint. how can signal child process parent process child initialised , can access endpoint?

i'd thought using semaphores purpose can't quite figure out how achieve required signal.

        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 form of signal here avoid..         controller.ping() // endpointnotfoundexception!! 

i use system-wide eventwaithandle this. parent application can wait child process signal event.

both processes create named event , 1 waits signalled.

// i'd use guid system-wide name // ensure uniqueness. make sure both parent // , child process know guid. var handle = new eventwaithandle(     false,     eventresetmode.autoreset,     "mysystemwideuniquename"); 

while child process signal event calling handle.set(), parent process waits set using 1 of waitone methods.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

aspxgridview - Devexpress grid - header filter does not work if column is initially hidden -

c# - How to execute a particular part of code asynchronously in a class -