NamedPipe and sendMessage, freeze

Running JUCE 4.1 in XCode 6.2:

I create a namedpipe, and send a message through the pipe to see if anyone is conncted to it on the other side. If nobody has connected yet, I don't get a failed sendMessage, but instead it freezes and can't get out from
const int p = ::open (name.toUTF8(), flags);

inside the openPipe function in juce_posix_NamedPipe.cpp


it works as it should on Windows though!

// Jacob


Hi JacobNoren,

can you try adding the O_NONBLOCK flag to line 101 in juce_posix_NamedPipe.cpp:

pipeOut = openPipe (createdPipe ? pipeOutName : pipeInName, O_WRONLY | O_NONBLOCK, timeoutEnd);

This worked for me.



Thanks for the reply, yes that works for me too!

// Jacob

Hello, this worked for me too.

Would it be possible to incorporate some option for this into the NamedPipe/InterProcessConnection? Otherwise I would have to alter this line after every update of Juce.



Hm, I’ve just run into this issue as well. Did you find an elegant way around it?