コード例 #1
0
        public void Load()
        {
            SessionsPoolingAmount = int.Parse(System.Configuration.Read("gameserver.maxc"));
            int SessionsPoolingBuffersize = 512;

            SocketBufferStacker = new SocketBufferStacker(SessionsPoolingAmount, SessionsPoolingBuffersize);
            SocketArgsStacker   = new SocketArgsStacker(SessionsPoolingAmount);
            ThreadSupressor     = new Semaphore(SessionsPoolingAmount, SessionsPoolingAmount);
            SessionsInteger     = new SafeInteger(0, false);
            Sessions            = new Dictionary <int, Session>();

            //System.IOStreamer.AppendLog("There are " + SessionsPoolingAmount + " EventArgs loaded.");

            CallAsync(null);
        }
コード例 #2
0
ファイル: NetworkSocket.cs プロジェクト: devMextur/Tazqon
        /// <summary>
        /// Starts the Environment of AsyncSockets.
        /// </summary>
        public void Serialize()
        {
            int SessionsPoolingAmount = System.Configuration.PopInt32("Sessions.Pooling.Amount");
            int SessionsPoolingBuffersize = System.Configuration.PopInt32("Sessions.Pooling.Buffersize");

            SocketBufferStacker = new SocketBufferStacker(SessionsPoolingAmount, SessionsPoolingBuffersize);
            SocketArgsStacker = new SocketArgsStacker(SessionsPoolingAmount);
            ThreadSupressor = new Semaphore(SessionsPoolingAmount, SessionsPoolingAmount);
            SessionsInteger = new SafeInteger(0, false);
            Sessions = new Dictionary<int, Session>();

            System.IOStreamer.AppendLine("There are {0} EventArgs(s) stacked. [{1}b]", SessionsPoolingAmount, SocketBufferStacker.BufferLength);

            CallAsync(null);
        }