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:
parent
79dd44db09
commit
b5271fa6cb
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user