Ejemplo n.º 1
0
 /// <summary>
 /// ctor
 /// </summary>
 /// <param name="name"></param>
 protected ResourceGroup(string name)
 {
     this.name  = name;
     _lock      = new LockParam();
     _remove    = new Queue <ResourceLoader>();
     _loaderMap = new Dictionary <string, ResourceLoader>();
 }
Ejemplo n.º 2
0
        public NetConnectionTokenPool(int timerSpace)
        {
            this.timerSpace = timerSpace < 2 ? 2 : timerSpace;
            lockParam       = new LockParam();
            int _period = TimerSpaceToSeconds();

            list  = new LinkedList <NetConnectionToken>();
            timer = new Timer(new TimerCallback(TimerLoop), null, _period, _period);
        }
Ejemplo n.º 3
0
 public PacketReader(int capacity = 128)
 {
     if (capacity < 128)
     {
         capacity = 128;
     }
     capacity   += 1;
     packetQueue = new PacketQueue(capacity);
     lockParam   = new LockParam();
 }
Ejemplo n.º 4
0
 public NetPacketProvider(int capacity)
 {
     if (capacity < 128)
     {
         capacity = 128;
     }
     capacity    += 1;
     _packetQueue = new PacketQueue(capacity);
     _lockParam   = new LockParam();
 }
Ejemplo n.º 5
0
        public TokenConnectionManager(int period)
        {
            _period = period < 2 ? 2 : period;

            _lockParam = new LockParam();
            var tempPeriod = GetPeriodSeconds();

            _list             = new LinkedList <NetConnectionToken>();
            _timeoutThreading = new Timer(timeoutHandler, null, tempPeriod, tempPeriod);
        }
Ejemplo n.º 6
0
 public TcpServerToken(int maxConCount, int bufferSize) : base(bufferSize)
 {
     this._maxConCount = maxConCount;
     this.bufferSize   = bufferSize;
     _recBuffMgr       = new SockArgBuffers(maxConCount + _offsetNumber, bufferSize);
     _sendBuffMgr      = new SockArgBuffers(maxConCount + _offsetNumber, bufferSize);
     _sendArgs         = new SocketEventArgPool(maxConCount + _offsetNumber);
     _receiveArgs      = new SocketEventArgPool(maxConCount + _offsetNumber);
     _lockParam        = new LockParam();
     _countSema        = new Semaphore(maxConCount + _offsetNumber, maxConCount + _offsetNumber);
 }
Ejemplo n.º 7
0
        public TokenConnectionManager(int period)
        {
            if (period < 2)
            {
                this.period = 2;
            }
            else
            {
                this.period = period;
            }

            lockParam = new LockParam();
            int _period = GetPeriodSeconds();

            list             = new LinkedList <NetConnectionToken>();
            timeoutThreading = new Timer(new TimerCallback(timeoutHandler), null, _period, _period);
        }
Ejemplo n.º 8
0
 public Timer()
 {
     pool = new TimeTaskPool(); Tasks = new  Dictionary <string, FrameTask>(); param = new LockParam();
 }