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

Starting test server few changes

This commit is contained in:
glucaci 2016-12-16 12:20:56 +01:00
parent 79dd44db09
commit b5271fa6cb
2 changed files with 10 additions and 10 deletions

View File

@ -22,8 +22,6 @@ namespace LibMpcTest
_mpc = new Mpc(new IPEndPoint(IPAddress.Loopback, 6600));
Console.Out.WriteLine(_server.LogError);
var connected = Task.Run(async () => await _mpc.ConnectAsync()).Result;
if (connected)
{

View File

@ -30,8 +30,10 @@ namespace LibMpcTest
Console.Out.WriteLine($"Starting Server: {Process.StartInfo.FileName} {Process.StartInfo.Arguments}");
Process.Start();
LogOutput = Process.StandardOutput.ReadToEnd();
LogError = Process.StandardError.ReadToEnd();
Console.Out.WriteLine("mpd:");
Console.Out.WriteLine($"out: {Process.StandardOutput.ReadToEnd()}");
Console.Out.WriteLine($"err: {Process.StandardError.ReadToEnd()}");
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{
@ -45,9 +47,9 @@ namespace LibMpcTest
{
StartInfo = new ProcessStartInfo
{
FileName = "/bin/netstat",
FileName = "/bin/bash",
WorkingDirectory = "/bin/",
Arguments = "-ntpl",
Arguments = "-c \"sudo /bin/netstat -ntpl\"",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
@ -91,14 +93,14 @@ namespace LibMpcTest
private class Server
{
public static Server Linux = new Server(
fileName: "/usr/bin/mpd",
workingDirectory: "/usr/bin/",
arguments: string.Join(" ", Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf"), "-v"));
fileName: "/bin/bash",
workingDirectory: "/bin/",
arguments: $"-c \"sudo /usr/bin/mpd {Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf")} -v\"");
public static Server Windows = new Server(
fileName: Path.Combine(AppContext.BaseDirectory, "Server", "mpd.exe"),
workingDirectory: Path.Combine(AppContext.BaseDirectory, "Server"),
arguments: string.Join(" ", Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf"), "-v"));
arguments: $"{Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf")} -v");
private Server(string fileName, string workingDirectory, string arguments)
{