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));
|
_mpc = new Mpc(new IPEndPoint(IPAddress.Loopback, 6600));
|
||||||
|
|
||||||
Console.Out.WriteLine(_server.LogError);
|
|
||||||
|
|
||||||
var connected = Task.Run(async () => await _mpc.ConnectAsync()).Result;
|
var connected = Task.Run(async () => await _mpc.ConnectAsync()).Result;
|
||||||
if (connected)
|
if (connected)
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,10 @@ namespace LibMpcTest
|
|||||||
Console.Out.WriteLine($"Starting Server: {Process.StartInfo.FileName} {Process.StartInfo.Arguments}");
|
Console.Out.WriteLine($"Starting Server: {Process.StartInfo.FileName} {Process.StartInfo.Arguments}");
|
||||||
|
|
||||||
Process.Start();
|
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))
|
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
{
|
{
|
||||||
@ -45,9 +47,9 @@ namespace LibMpcTest
|
|||||||
{
|
{
|
||||||
StartInfo = new ProcessStartInfo
|
StartInfo = new ProcessStartInfo
|
||||||
{
|
{
|
||||||
FileName = "/bin/netstat",
|
FileName = "/bin/bash",
|
||||||
WorkingDirectory = "/bin/",
|
WorkingDirectory = "/bin/",
|
||||||
Arguments = "-ntpl",
|
Arguments = "-c \"sudo /bin/netstat -ntpl\"",
|
||||||
UseShellExecute = false,
|
UseShellExecute = false,
|
||||||
RedirectStandardOutput = true,
|
RedirectStandardOutput = true,
|
||||||
RedirectStandardError = true,
|
RedirectStandardError = true,
|
||||||
@ -91,14 +93,14 @@ namespace LibMpcTest
|
|||||||
private class Server
|
private class Server
|
||||||
{
|
{
|
||||||
public static Server Linux = new Server(
|
public static Server Linux = new Server(
|
||||||
fileName: "/usr/bin/mpd",
|
fileName: "/bin/bash",
|
||||||
workingDirectory: "/usr/bin/",
|
workingDirectory: "/bin/",
|
||||||
arguments: string.Join(" ", Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf"), "-v"));
|
arguments: $"-c \"sudo /usr/bin/mpd {Path.Combine(AppContext.BaseDirectory, "Server", "mpd.conf")} -v\"");
|
||||||
|
|
||||||
public static Server Windows = new Server(
|
public static Server Windows = new Server(
|
||||||
fileName: Path.Combine(AppContext.BaseDirectory, "Server", "mpd.exe"),
|
fileName: Path.Combine(AppContext.BaseDirectory, "Server", "mpd.exe"),
|
||||||
workingDirectory: Path.Combine(AppContext.BaseDirectory, "Server"),
|
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)
|
private Server(string fileName, string workingDirectory, string arguments)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user