コード例 #1
0
 public override bool Connect()
 {
     try
     {
         if (RobotClient == null)
         {
             RobotClientSetup();
         }
         if (ZarizeniJeDlePinguOnline)
         {
             RobotClient?.Connect();
         }
         bool status = false;
         status = RobotClient.Connected;
         if (status)
         {
             Status = Stav.Online;
             NastaveniHlidacihoPsa();
             HlidaciPes.Zapni();
         }
         return(status);
     }
     catch (Exception exception)
     {
         var zarizeniArgs = new ZarizeniArgs(Status, Ping, $"!CHYBA!", exception);
         OnStatusChanged(zarizeniArgs);
         return(false);
     }
 }
コード例 #2
0
 static void Main(string[] args)
 {
     RobotClient.Connect(new Program(), "127.0.0.1", 60604, 1361778219);
     while (true)
     {
         string msg = Console.ReadLine();
         RobotClient.SendMessage(msg);
     }
 }
コード例 #3
0
        protected override void PingniNaZarizeni()
        {
            base.PingniNaZarizeni();

            if (RobotClient != null)
            {
                if (RobotClient.Connected == false)
                {
                    RobotClient.Connect();
                }
            }
        }