-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
37 lines (34 loc) · 967 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Threading;
using System.Threading.Tasks;
namespace BalatroMessager
{
internal class Program
{
private const int DebugMessagePort = 12345;
private static readonly CancellationTokenSource Cts = new CancellationTokenSource();
static async Task Main(string[] args)
{
Console.CancelKeyPress += Console_CancelKeyPress;
try
{
var logCat = new LogCat(DebugMessagePort);
await logCat.Listen(Cts.Token);
}
catch (TaskCanceledException)
{
// Ignored.
}
catch (Exception ex)
{
Console.WriteLine(ex);
Console.ReadKey();
}
}
private static void Console_CancelKeyPress(object sender, ConsoleCancelEventArgs e)
{
e.Cancel = true;
Cts.Cancel();
}
}
}