suppress pipe broken exception

This commit is contained in:
HolographicHat
2025-08-02 08:18:09 +08:00
parent c4fb5a0366
commit ac818735c7

View File

@@ -214,6 +214,7 @@ public static class Utils {
return;
}
Task.Run(() => {
try {
using var stream = new NamedPipeServerStream(GlobalVars.PipeName);
using var reader = new BinaryReader(stream, System.Text.Encoding.UTF8, true);
using var writer = new BinaryWriter(stream, System.Text.Encoding.UTF8, true);
@@ -244,6 +245,7 @@ public static class Utils {
}
}
}
} catch (IOException e) when (e.Message == "Pipe is broken.") { } // SR.IO_PipeBroken
}).ContinueWith(task => { if (task.IsFaulted) OnUnhandledException(task.Exception!); });
_proc = new GameProcess(exePath);
_proc.LoadLibrary(GlobalVars.LibFilePath);