I would like to see an overloaded wait method on Poco/Process that takes a timeout in milliseconds and a reference to an exit code, i.e.:
bool ProcessHandle::wait(int milliseconds, int& exitCode) const
{
return impl->wait(milliseconds, exitCode);
}
This is quite do-able on Windoze because it can be implemented using WaitForSingleObject that has a timeout parameter.
A POSIX implementation is more tricky since wait does not have a timeout. It just blocks until the child finishes. It can only be interrupted by a signal, which would have to be sent from a thread after it had slept for the timeout period. Well, that's one way to do it anyway. The challenge there would be to pick a signal that is not already being used for something else.
This is an enhancement request so please feel free to put this to the bottom of the pile......what do people think? Would this be useful?
Regards,
Andrew Marlow





