Avoiding `readavailable()` when communicating with long-lived external program

For the sake of the discussion, I believe I am working on a somewhat similar problem, see e.g. here for some context.

Basically I implemented a small IPC between a C# program and julia (mostly because embedding the julia library in C# was quite painful). This IPC is performed over named pipes.

My main current problems are

  1. while I think these pipes should be able to support two-way communications, it does not seem to be possible on julia’s side. My current solution is to use one pipe for the input and one for the output.
  2. I should be able to keep the pipe open as long as my C# and julia programs run, but actually I create a pipe using listen once then keep doing connect -- read/write -- close in a while-loop because I can’t figure how to not block the pipe.
    Fortunately, I do not need to be very fast for this application, but it doesn’t feel right to keep opening and closing sockets.

This does not help solving your issue, but at least you know you are not alone on this !

2 Likes