private static void TestRtl(SessionInfo sessionInfo) { XmlMessageClient xmlMessageClient = new XmlMessageClient(new IPAddress(0x85CD280A), 4502, Config.ValidSuperUserName, sessionInfo.SessionGuid); new MessageProcessingService(xmlMessageClient); Console.WriteLine("Press ESC to stop..."); do { while (!Console.KeyAvailable) { // Do something } } while (Console.ReadKey(true).Key != ConsoleKey.Escape); xmlMessageClient.Stop(); }