1
0
mirror of https://github.com/ZetaKebab/MpcNET.git synced 2025-01-14 22:18:43 +00:00

Test debugging code

This commit is contained in:
glucaci 2016-12-16 12:07:03 +01:00
parent cd6f877380
commit 79dd44db09

View File

@ -32,6 +32,35 @@ namespace LibMpcTest
Process.Start();
LogOutput = Process.StandardOutput.ReadToEnd();
LogError = Process.StandardError.ReadToEnd();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
CheckIfServerIsRunning();
}
}
private void CheckIfServerIsRunning()
{
var netcat = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = "/bin/netstat",
WorkingDirectory = "/bin/",
Arguments = "-ntpl",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = true,
}
};
netcat.Start();
netcat.WaitForExit();
Console.Out.WriteLine("netstat:");
Console.Out.WriteLine($"out: {netcat.StandardOutput.ReadToEnd()}");
Console.Out.WriteLine($"err: {netcat.StandardError.ReadToEnd()}");
}
private Server GetServer()