bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Remaining APserver issues


From: Juergen Sauermann
Subject: Re: [Bug-apl] Remaining APserver issues
Date: Thu, 31 Jul 2014 16:50:21 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130330 Thunderbird/17.0.5

Hi Elias,

thanks - that explains a lot.

I changed the code to use popen() rather than fork() + execve().
That way I can see when APserver has bound its socket. SVN 409.

/// Jürgen


On 07/31/2014 12:24 PM, Elias Mårtenson wrote:
I did another test and added a two-second sleep after attempting to connect to the APserver, and that removed the problem. Thus, I conclude that the issue is that the APserver doesn't have time to initialise before the parent tries to connect.

I'd like to propose that APserver sends a message to the parent instead of having an arbitrary sleep (right now it's 20 ms, I believe). There are a few different ways of doing this. Here are a few:
  • The parent redirects stdout and waits for a message from APserver
  • The same as above, but the apl session opens a named pipe, passed in the name of the pipe to APserver and the message is sent over that channel instead.
  • APserver detaches and forks itself into the background once all initialisation has been performed. The parent apl session waits for the "parent" APserver to exit before attempting to connect.
  • The apl session attempts multiple retries over a few seconds before giving up.
I'm sure there are other ways to handle it as well. At least we know what the problem is now. :-)

Regards,
Elias




reply via email to

[Prev in Thread] Current Thread [Next in Thread]