Reduced main method

This commit is contained in:
glax 2023-11-30 15:27:52 +01:00
parent 18872ad5bc
commit b98154ffcc

View File

@ -8,20 +8,7 @@ public class OSCCollar
public static void Main(string[] args)
{
OSCCollar collar;
if (args.Length == 3)
{
string ip = args[0];
if(!IPAddress.TryParse(args[0], out IPAddress? _) ||
!int.TryParse(args[1], out var portReceive) ||
!int.TryParse(args[2], out var portSend))
{
Console.WriteLine("Invalid parameter.\n\rParameters <ip> <receivePort> <sendPort>");
return;
}
collar = new OSCCollar(ip, portReceive, portSend);
}else
collar = new OSCCollar();
OSCCollar collar = new OSCCollar();
}
private OscServer Server { get; init; }