Exemplo n.º 1
0
 /// <summary>
 /// Creates a connection for this connection context
 /// </summary>
 /// <param name="connectionId"></param>
 /// <param name="hubChannelManager"></param>
 private void AddConnection(string connectionId, HubChannelManager hubChannelManager = null)
 {
     if (this.Connections.ContainsKey(connectionId) == false)
     {
         var channelManager = hubChannelManager ?? new HubChannelManager();
         this.Connections.Add(connectionId, channelManager);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Saves the channel registered for this connection context
 /// </summary>
 /// <param name="connectionId"></param>
 /// <param name="channel"></param>
 private void SaveChannel(string connectionId, string channel)
 {
     if (this.Connections.ContainsKey(connectionId))
     {
         var hubChannelManager = this.Connections[connectionId];
         hubChannelManager.AddChannel(channel, this.Context.User.Identity);
     }
     else
     {
         var hubChannelManager = new HubChannelManager();
         hubChannelManager.AddChannel(channel, this.Context.User.Identity);
         this.AddConnection(connectionId, hubChannelManager);
     }
 }