Ejemplo n.º 1
0
 public void Remove(LynexWebSocketHandler webSocketHandler)
 {
     if (webSocketHandler is PiWebSocketHandler)
     {
         PiCollection.Remove(webSocketHandler);
     }
     else if (webSocketHandler is ClientWebSocketHandler)
     {
         ClientCollection.Remove(webSocketHandler);
     }
 }
Ejemplo n.º 2
0
 public void Add(LynexWebSocketHandler webSocketHandler)
 {
     if (webSocketHandler is PiWebSocketHandler)
     {
         if (PiCollection.Any())
         {
             var tempCollection = PiCollection.ToList();
             foreach (var socketHandler in tempCollection)
             {
                 socketHandler.Close();
             }
             PiCollection.Clear();
         }
         PiCollection.Add(webSocketHandler);
     }
     else if (webSocketHandler is ClientWebSocketHandler)
     {
         ClientCollection.Add(webSocketHandler);
     }
 }