Пример #1
0
        private void OnConnectionClosed(object?sender, EventArgs e)
        {
            var connection = sender as IWebSocketConnection ?? throw new ArgumentException($"{nameof(sender)} is not of type {nameof(IWebSocketConnection)}", nameof(sender));

            _logger.LogDebug("Removing websocket from session {Session}", _session.Id);
            _sockets.Remove(connection);
            connection.Closed -= OnConnectionClosed;
            _sessionManager.CloseIfNeeded(_session);
        }
Пример #2
0
        private void OnConnectionClosed(object sender, EventArgs e)
        {
            var connection = (IWebSocketConnection)sender;

            _logger.LogDebug("Removing websocket from session {Session}", _session.Id);
            _sockets.Remove(connection);
            connection.Closed -= OnConnectionClosed;
            _sessionManager.CloseIfNeeded(_session);
        }
Пример #3
0
        void connection_Closed(object sender, EventArgs e)
        {
            var connection = (IWebSocketConnection)sender;
            var sockets    = Sockets.ToList();

            sockets.Remove(connection);

            Sockets = sockets;

            _sessionManager.CloseIfNeeded(Session);
        }