Make testing for live processes more robust

This commit is contained in:
Richard Frith-Macdonald 2019-08-23 15:05:16 +01:00
parent c872e2dabc
commit 3662db65da
2 changed files with 25 additions and 2 deletions

View file

@ -1,3 +1,10 @@
2019-08-23 Richard Frith-Macdonald <rfm@gnu.org>
* EcCommand.m:
When checking to see if a process is alive/responding, set a short
timeout for the DO request to get a proxy to the process so that
we don't hang waiting for a response that never comes.
2019-08-11 Richard Frith-Macdonald <rfm@gnu.org>
* EcProcess.h:

View file

@ -518,10 +518,26 @@ static NSMutableDictionary *launchInfo = nil;
NS_DURING
{
proxy = (id<CmdClient>)[NSConnection
rootProxyForConnectionWithRegisteredName: name
NSConnection *c;
c = [NSConnection
connectionWithRegisteredName: name
host: @""
usingNameServer: [NSSocketPortNameServer sharedInstance]];
NS_DURING
{
/* Do not hang waiting for the other end to respond.
*/
[c setRequestTimeout: 5.0];
[c setReplyTimeout: 5.0];
proxy = (id<CmdClient>)[c rootProxy];
}
NS_HANDLER
{
[c setRequestTimeout: 0.0];
[c setReplyTimeout: 0.0];
}
NS_ENDHANDLER
if (nil != proxy)
{
[proxy ecReconnect];