Exemplo n.º 1
0
 public override System.Threading.Tasks.Task OnConnected()
 {
     lock (s_clients)
     {
         GuacClient client = new GuacClient(this.Context.ConnectionId);
         s_clients.Add(client.Id, client);
         client.Start();
     }
     return(base.OnConnected());
 }
Exemplo n.º 2
0
 public override System.Threading.Tasks.Task OnDisconnected(bool stopCalled)
 {
     lock (s_clients)
     {
         if (s_clients.ContainsKey(this.Context.ConnectionId))
         {
             using (GuacClient client = s_clients[this.Context.ConnectionId])
             {
                 s_clients.Remove(client.Id);
             }
         }
     }
     return(base.OnDisconnected(stopCalled));
 }