Exemple #1
0
        public static bool onConnect(Socket socket)
        {
            if (!mActive)
            {
                return(false);
            }

            lock (mConnectionList.SyncRoot)
            {
                if (mConnectionList.Count >= cMaxConnections)
                {
                    return(false);
                }

                DebugConnection connection = new DebugConnection(mTextCallback, mConnectionList.Count);
                if (!connection.connect(socket))
                {
                    return(false);
                }

                if (!mActive)
                {
                    return(false);
                }

                mConnectionList.Add(connection);
            }

            return(true);
        }