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); } }
static void Main(string[] args) { RobotClient.Connect(new Program(), "127.0.0.1", 60604, 1361778219); while (true) { string msg = Console.ReadLine(); RobotClient.SendMessage(msg); } }
protected override void PingniNaZarizeni() { base.PingniNaZarizeni(); if (RobotClient != null) { if (RobotClient.Connected == false) { RobotClient.Connect(); } } }