I’m trying to user InterprocessCommunication to 1) Check if another instance of the application is up and 2) If it is, send the command line to the active instance. So I first try to createPipe because docs say:
"If another process is already using this pipe, this will fail and return false."
This is not true. Both instances of the appl have NO problems whatsoever to create the same named pipe. Argh!!
Are you aware of JUCEApplication::anotherInstanceStarted()? maybe it can be of help to you.
anotherProcessStarted() would certainly be a better way to do what you describe, but I’m a bit worried that the interprocess stuff isn’t working. What OS is this?
Dammit, I’m trying to find a thread where we (I & Jules) discussed that the whole mechanism of anotherInstanceStarted is non-functional on Mac OS X, but I can’t find it (even by searching threads in which I’ve posted)!! Also, the conclusion was that Jules recommended me to “roll my own”, ring any bells ?
Oh, and to use an InterprocessLock doesn’t work, well… it does work, but for admin users only. If you try to run the application as a “Standard” user, InterprocessLock will always be “locked” (indicating another instance is active).
So you mean that it was failing because you were making the call during a modal loop in the initialisation method?
(I actually think that in more recent versions I changed things so that the app’s initialise method gets called later, to avoid this kind of problem)
Sorry, I don’t quite follow ? I have no modal loops. The InterprocessLock::enter(0) always returns false when running under a “Standard” user, which means you can’t execute the application at all (as that is the condition for another active instance). But when running with a “Admin” user, it works as expected.
I was talking about the thread that you linked to, where it was talking about not receiving events during the JUCEApplication::initialise() method (?)
I think I also fixed the admin permissions problem very recently, just because it needed to use a different folder for its temp files.
Ah, I see. Well I do use 1.53 (oops I didn’t mention that,did I ? so that will be fixed then. Regarding receiving events, I won’t have that particular problem.
Well… the HTTP stuff uses events internally, so it could indeed be causing your network problem.
Well… the HTTP stuff uses events internally, so it could indeed be causing your network problem.[/quote]
But I’m well out of initialise when we talk http stuff (which is unrelated to this thread)… :?
Gah… sorry, so many threads!
Hi Jules, do you know in which commit these issues were fixed ?
Hi Jules, do you know in which commit these issues were fixed ?[/quote]
Not off the top of my head, but think it was within the last month.
Hmm… last commit for juce_posix_SharedCode.h (where IPL is implemented) was 3rd of july 2011, am I looking in the wrong place ? :?
You’re probably looking at that file before it got moved to a new location in the modules shake-up.
Ouch, ok, then a quick pointer to where I should look now would be appreciated