Launching a child process : best method

I tried 2 ways of starting a child process : 


aPluginFile.startAsProcess(aParameters);

 

and

 

const juce::String temp = aPluginFile.getFullPathName() + " " + aParameters;
bool result = mServerProcess.start(temp, 0);
jassert(result);
 

 

What's the difference between the 2 ? I'm using a custom IPC library and it works fine with the first method (aPluginFile.startAsProcess(aParameters);) but with the second (mServerProcess.start(temp, 0);), it starts by working but after a little while the connection seems to timeout but I have no idea why. 

 

Aren't the two options strictly identical ? 

(I need to use the second version because I need control over the process, like kill, restart etc ...) 

 

Any advice is welcome ! 

 

 

Up ?

Well, ChildProcess is the best way if you need control over the process.