connectionLost is never triggered


Good evening everybody,

I’m trying to use InterprocessConnection but its virtual method connectionLost isn’t triggered when the listening pipe is closed (or the owner process is shut).
The same behaviour happens with the Juce demo.

And, it seems that calling disconnect() on an non-opened connection cause the application to hang (I suppose it may be the same problem cause the disconnect() method calls the internal connectionLost).

Thank you for your help.


Well, connectionLost gets called when something fails, e.g. when you attempt to send a message, and it doesn’t arrive. It may be called if a read fails, but it’s not necessarily possible to detect whether the remote process is still active without sending a ping message and seeing whether it arrives. The InterprocessConnection class won’t automatically do any pinging, you’d need to use your own thread for that.