Пример #1
0
        private Client GetClient(string deviceId)
        {
            // If client alreay exist. just bring it
            var client = Clients.Find(x => x.DeviceID == deviceId);

            // Create New Client and Add it to Clients List
            if (client == null)
            {
                client = new Client(deviceId);
                Clients.Add(client);

                // Init hubs for the new client
                foreach (var kvp in hubRoutesDict)
                {
                    var hubObj = new HubObject(kvp.Key, kvp.Value, client);
                    client.AddHubObject(hubObj);
                }
            }

            return(client);
        }
Пример #2
0
 public void AddHubObject(HubObject hub)
 {
     Hubs.Add(hub);
 }