public static WebSocketHandler CreateFor <T>(IServiceProvider serviceProvider)
            where T : IWebsocketController
        {
            var logger = serviceProvider.GetService <ILoggerFactory>()
                         .CreateLogger(nameof(WebSocketHandler) + " for " + typeof(T).FullName);
            var clients    = new ClientDictionary();
            var controller = ActivatorUtilities.CreateInstance <T>(serviceProvider, clients.ClientCollection);

            return(ActivatorUtilities.CreateInstance <WebSocketHandler>(serviceProvider, controller, clients, logger));
        }
 public ClientCollection(ClientDictionary clientDictionary)
 {
     _clientDictionary = clientDictionary;
 }
 public WebSocketHandler(IWebsocketController controller, ClientDictionary clients, ILogger logger)
 {
     _controller = controller ?? throw new ArgumentNullException(nameof(controller));
     _clients    = clients ?? throw new ArgumentNullException(nameof(clients));
     _logger     = logger;
 }