private async Task AsyncPingTelnetServer()
        {
            await TelnetClient.WriteLine("ping");

            await Task.Delay(2000);

            await ReadAndSendEvent(true);
        }
 public void WriteLine(string line)
 {
     try
     {
         if (TelnetClient == null)
         {
             Console.WriteLine("*** telnetClient not initialized ***");
             return;
         }
         else if (TelnetClient.IsConnected == false)
         {
             Console.WriteLine("*** telnetClient not connected ***");
             return;
         }
         TelnetClient.WriteLine(line);
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.ToString());
         Console.WriteLine("*** Exception occured in WriteLine - wait 10 seconds before going on ***");
     }
 }
Beispiel #3
0
        public static void SendChat(TelnetClient telnet, string message)
        {
            TelnetException.CheckTelnetClient(telnet);

            telnet.WriteLine("say " + message);
        }