# InterprocessCommunication not working

**URL:** <https://forum.juce.com/t/interprocesscommunication-not-working/7951>\
**Category:** MacOSX and iOS\
**Created:** [January 4, 2012, 6:08pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951 "2012-01-04T18:08:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 4, 2012, 6:08pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/1 "2012-01-04T18:08:29Z")

</div>

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:  
[http://www.rawmaterialsoftware.com/juce/api/classInterprocessConnection.html#a7ddea65e7dbb25d1d471db7355743276](http://www.rawmaterialsoftware.com/juce/api/classInterprocessConnection.html#a7ddea65e7dbb25d1d471db7355743276)  
"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!!

---

<div class="post-metadata">

**Author:** ![Shlomi](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/shlomi/32/99_2.png) [@Shlomi](https://forum.juce.com/u/Shlomi)\
**Post date:** [January 4, 2012, 6:14pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/2 "2012-01-04T18:14:31Z")

</div>

Are you aware of JUCEApplication::anotherInstanceStarted()? maybe it can be of help to you.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 4, 2012, 6:35pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/3 "2012-01-04T18:35:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 4, 2012, 8:57pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/4 "2012-01-04T20:57:47Z")

</div>

> [@Shlomi](#):
>
> Are you aware of JUCEApplication::anotherInstanceStarted()? maybe it can be of help to you.

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 ?

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 4, 2012, 8:58pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/5 "2012-01-04T20:58:40Z")

</div>

> [@jules](#):
>
> 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?

10.6.7

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 4, 2012, 9:02pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/6 "2012-01-04T21:02:44Z")

</div>

Found it!! [http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=6436](http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=6436)

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 4, 2012, 9:06pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/7 "2012-01-04T21:06:08Z")

</div>

> [@robiwan](#):
>
> Found it!! [http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=6436](http://www.rawmaterialsoftware.com/viewtopic.php?f=2&t=6436)

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).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 5, 2012, 10:53am UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/8 "2012-01-05T10:53:05Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 5, 2012, 1:30pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/9 "2012-01-05T13:30:36Z")

</div>

> [@jules](#):
>
> So you mean that it was failing because you were making the call during a modal loop in the initialisation method?

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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 5, 2012, 1:32pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/10 "2012-01-05T13:32:54Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 5, 2012, 1:38pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/11 "2012-01-05T13:38:05Z")

</div>

> [@jules](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 5, 2012, 1:39pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/12 "2012-01-05T13:39:56Z")

</div>

> [@](#):
>
> 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.

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 5, 2012, 1:47pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/13 "2012-01-05T13:47:34Z")

</div>

> [@jules](#):
>
> [quote]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.[/quote]  
But I’m well out of initialise when we talk http stuff (which is unrelated to this thread)… :?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 5, 2012, 1:54pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/14 "2012-01-05T13:54:46Z")

</div>

Gah… sorry, so many threads!

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 5, 2012, 2:05pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/15 "2012-01-05T14:05:03Z")

</div>

> [@jules](#):
>
> Gah… sorry, so many threads!

😃

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 11, 2012, 3:46pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/16 "2012-01-11T15:46:00Z")

</div>

> [@jules](#):
>
> I think I also fixed the admin permissions problem very recently, just because it needed to use a different folder for its temp files.

Hi Jules, do you know in which commit these issues were fixed ?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 11, 2012, 4:08pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/17 "2012-01-11T16:08:37Z")

</div>

> [@robiwan](#):
>
> [quote=“jules”]I think I also fixed the admin permissions problem very recently, just because it needed to use a different folder for its temp files.

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.

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 11, 2012, 4:13pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/18 "2012-01-11T16:13:21Z")

</div>

> [@jules](#):
>
> 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 ? :?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [January 11, 2012, 4:25pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/19 "2012-01-11T16:25:04Z")

</div>

You’re probably looking at that file before it got moved to a new location in the modules shake-up.

---

<div class="post-metadata">

**Author:** ![robiwan](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/robiwan/32/2446_2.png) [@robiwan](https://forum.juce.com/u/robiwan)\
**Post date:** [January 11, 2012, 4:27pm UTC](https://forum.juce.com/t/interprocesscommunication-not-working/7951/20 "2012-01-11T16:27:13Z")

</div>

> [@jules](#):
>
> 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 🙂

[Next page](https://forum.juce.com/t/interprocesscommunication-not-working/7951.md?page=2)
