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); }
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); }