Add new log command and some general command improvments

This commit is contained in:
Stone_Red
2023-12-13 21:34:57 +01:00
parent b009d1ac64
commit 8a587ee627
13 changed files with 319 additions and 118 deletions
@@ -11,9 +11,8 @@ internal class BroadcastClient
{
public event EventHandler<BroadcastRecivedEventArgs>? OnBroadcastRecived;
public bool IsListening { get; private set; } = false;
private UdpClient? udpListener;
public bool IsListening { get; private set; } = false;
public static void Send(int port, string message)
{
@@ -58,7 +57,7 @@ internal class BroadcastClient
udpListener = new UdpClient(port);
IPEndPoint groupEP = new IPEndPoint(IPAddress.Any, port);
_ = Task.Run(() =>
_ = new TaskFactory().StartNew(() =>
{
while (IsListening)
{
@@ -67,7 +66,7 @@ internal class BroadcastClient
OnBroadcastRecived?.Invoke(this, new BroadcastRecivedEventArgs(groupEP, message));
}
});
}, TaskCreationOptions.LongRunning);
}
public void StopListening()