public static void Main(string[] args) { StartConnectionAsync(); _strategy.On("receiveMessage", (arguments) => { Console.WriteLine($"{arguments[0]} said: {arguments[1]}"); }); Console.ReadLine(); StopConnectionAsync(); }
static void Main(string[] args) { StartConnectionAsync(); _strategy.On("receiveMessage", (arguments) => { Console.WriteLine($"{arguments[0]} said: {arguments[1]}"); }); Console.ReadLine(); ConsoleKeyInfo key = Console.ReadKey(); if (key.Key.Equals(ConsoleKey.Escape)) { StopConnectionAsync(); } }