Esempio n. 1
0
        internal void InitializePool(IOPool pool)
        {
            if (IOPool != null)
                throw new NotSupportedException("Cannot reset IOPool");

            if (pool == null)
                throw new ArgumentNullException("pool");

            IOPool = pool;
            OnPoolInitialization();
        }
Esempio n. 2
0
        internal static IEnumerable<Block> createRandomBlocks(int blockSize, int blockCount, IOPool pool)
        {
            var result = new List<Block>();
            for (var i = 0; i < blockCount; ++i)
            {
                var data = new byte[blockSize];
                var block = pool.CreateConstantBlock(data);
                result.Add(block);
            }

            return result;
        }
Esempio n. 3
0
        internal NetworkManager(IOPool pool)
        {
            _pool = pool;
            _clientSlots = new ClientInternal[pool.Configuration.MaxClientCount];
            _freeSlots = new Stack<int>(_clientSlots.Length);

            for (var i = 0; i < _clientSlots.Length; ++i)
            {
                var clientInternal = new ClientInternal(this, i);
                _clientSlots[i] = clientInternal;
                _freeSlots.Push(i);
            }
        }
Esempio n. 4
0
 internal ClientController(IOPool pool)
 {
     Pool = pool;
 }
Esempio n. 5
0
 internal DataSentController(IOPool pool)
     : base(pool)
 {
 }
Esempio n. 6
0
 internal DataReceivedController(IOPool pool)
     : base(pool)
 {
 }