Exemple #1
0
        void _listener_OnConnect(StompServerClient client)
        {
            lock (this)
            {
                if (_clients.Count + 1 > StompConfiguration.MaxClients)
                {
                    if (StompLogger.CanLogWarning)
                    {
                        StompLogger.LogWarning("Maximum clients (" + StompConfiguration.MaxClients + ") reached. Disconnecting " + client.ToString());
                    }
                    client.Stop();
                    return;
                }

                _clients.Add(client);
            }

            InitClientsEvents(client);

            StompStatistics.AddConnectedClient();

            client.Start();

            if (StompLogger.CanLogDebug)
            {
                StompLogger.LogDebug(client.ToString() + " connected");
            }
        }
        void _listener_OnConnect(StompServerClient client)
        {
            lock (this)
            {
                if (_clients.Count + 1 > StompConfiguration.MaxClients)
                {
                    if (StompLogger.CanLogWarning)
                        StompLogger.LogWarning("Maximum clients ("+StompConfiguration.MaxClients+") reached. Disconnecting " + client.ToString());
                    client.Stop();
                    return;
                }

                _clients.Add(client);
            }

            InitClientsEvents(client);

            StompStatistics.AddConnectedClient();

            client.Start();

            if (StompLogger.CanLogDebug)
                StompLogger.LogDebug(client.ToString() + " connected");
        }