NamedPipe and sendMessage, freeze


#1

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


 


#2

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.

Fabian

 


#3

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

// Jacob


#4

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.

Best,

Thomas


#5

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