public void Remove(LynexWebSocketHandler webSocketHandler)
 {
     if (webSocketHandler is PiWebSocketHandler)
     {
         PiCollection.Remove(webSocketHandler);
     }
     else if (webSocketHandler is ClientWebSocketHandler)
     {
         ClientCollection.Remove(webSocketHandler);
     }
 }
 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);
     }
 }