Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Best way to mark Client Offline using Web-Service
- [WebMethod]
- public string Connect(Size desktopsize)
- {
- Client clienti = new Client();
- clienti.ID = "Client_" + Counter.ToString();
- clienti.Desktopsize = desktopsize;
- clienti.Lastupdate = DateTime.Now;
- Counter++;
- clients.Add(clienti);
- return clienti.ID;
- }
- public bool SingleClick
- {
- get
- {
- bool tmpBolean = singleclick;
- singleclick = false;
- return tmpBolean;
- }
- set
- {
- this.lastupdate = DateTime.Now;
- singleclick = value;
- }
- }
- private void CheckOnlinestate()
- {
- while (isRunning)
- {
- TimeSpan ts = DateTime.Now - lastupdate;
- if (ts.TotalMinutes >= 1)
- {
- isRunning = false;
- this.Dispose();
- }
- }
- }
- public void CheckClients()
- {
- while (true)
- {
- foreach (Client c in clients)
- {
- if (c.ShouldDispose)
- {
- clients.Remove(c);
- }
- }
- Thread.Sleep(200);
- }
- }
Add Comment
Please, Sign In to add comment