The program I'm writing is using FIFO pipes in linux for inter-process communication. It's rather hacky at best, but regardless I'm having issues.
if (!File.Exists(Path.GetTempPath() + "gminput.pipe"))
{
ProcessStartInfo startInfo = new ProcessStartInfo() { FileName = "/usr/bin/mkfifo", Arguments = Path.GetTempPath() + "gminput.pipe", };
Process proc = new Process() { StartInfo = startInfo, };
proc.Start();
proc.WaitForExit();
}
if (!File.Exists(Path.GetTempPath() + "gmoutput.pipe"))
{
ProcessStartInfo startInfo = new ProcessStartInfo() { FileName = "/usr/bin/mkfifo", Arguments = Path.GetTempPath() + "gmoutput.pipe", };
Process proc = new Process() { StartInfo = startInfo, };
proc.Start();
proc.WaitForExit();
}
using (StreamWriter outputPipe = new StreamWriter(Path.GetTempPath() + "gmoutput.pipe"))
using (StreamReader inputPipe = new StreamReader(Path.GetTempPath() + "gminput.pipe"))
{
Console.WriteLine("This code is never reached!");
}
All I'm doing is checking if the pipe already exists, and if not, call mkfifo to create it. This part seems to work fine, the named pipes are created correctly. Whenever I try to open them (either with the StreamWriter, StreamReader, or both), the program just hangs. No errors or anything. It hangs in the debugger too.
The best part is...it used to work. I had the inter-process communication working and then it just inexplicably stopped. I commented out everything except what you see here, restarted my system, recreated the pipes, etc, to no avail. What gives? Is there something wrong with my code or is something else on the system interfering?