Exemple #1
0
        public ClientStatus Clone()
        {
            ClientStatus rtv = new ClientStatus {
                speed             = this.Speed,
                RealSpeed         = this.RealSpeed,
                TargetTemperature = this.TargetTemperature,
                NowTemperature    = this.NowTemperature,
                Cost          = this.Cost,
                LastHeartBeat = this.LastHeartBeat
            };

            return(rtv);
        }
Exemple #2
0
        public RemoteClient(TcpClient client, IHostServiceCallback callback)
        {
            this.tcpclient = client;
            LOGGER.InfoFormat("Client Connected! {0} < -- {1}",
                              client.Client.LocalEndPoint, client.Client.RemoteEndPoint);
            streamToClient = client.GetStream();
            clientStatus   = new ClientStatus();
            this.callback  = callback;

            heartBeatTimer           = new System.Timers.Timer(5000);
            heartBeatTimer.AutoReset = true;
            heartBeatTimer.Elapsed  += this.heartBeat;

            requestThread = new System.Threading.Thread(run);
            requestThread.Start(callback);
        }