Example #1
0
        public bool destroy()
        {
#if !UseTimer
            _ScheduleExecutor = null;
#endif
            return(true);
        }
Example #2
0
        public void initialize(int capacity)
        {
            MaxConnectedClientLimit = capacity;

            socketListener = new SocketListener(capacity, (int)TCPCmdPacketSize.RECV_MAX_SIZE);
            socketListener.SocketClosed    += SocketClosed;
            socketListener.SocketConnected += SocketConnected;
            socketListener.SocketReceived  += SocketReceived;
            socketListener.SocketSended    += SocketSended;

            _tcpClientPool = TCPClientPool.getInstance();
            _tcpClientPool.initialize(100);
            _tcpLogClientPool = TCPClientPool.getLogInstance();
            _tcpLogClientPool.initialize(100);

            tcpInPacketPool = new TCPInPacketPool(capacity);
            /*tcpOutPacketPool = new TCPOutPacketPool(capacity);*/
            TCPOutPacketPool.getInstance().initialize(capacity);
            tcpOutPacketPool = TCPOutPacketPool.getInstance();
            dictInPackets    = new Dictionary <TMSKSocket, TCPInPacket>(capacity);
            tcpSessions      = new Dictionary <TMSKSocket, TCPSession>();
            TCPCmdDispatcher.getInstance().initialize();
#if UseTimer
            taskExecutor = new ScheduleExecutor(0);
#else
            taskExecutor = new ScheduleExecutor(1);
#endif
            taskExecutor.start();
        }
Example #3
0
        public bool initialize()
        {
#if !UseTimer
            //分配1个线程
            _ScheduleExecutor = new ScheduleExecutor(1);

            //加入循环任务
            _PeriodicTaskHandle = _ScheduleExecutor.scheduleExecute(this, 0L, 100);
#else
            ScheduleExecutor2.Instance.scheduleExecute(this, 0, 30000);
#endif

            return(true);
        }
Example #4
0
        public bool initialize()
        {
            //分配2个线程
            _ScheduleExecutor = new ScheduleExecutor(2);

            //加入循环任务
            _PeriodicTaskHandle = _ScheduleExecutor.scheduleExecute(this, 0L, 100);

            DailyPushMsgDayID = -1;

            //测试推送消息
            //GetuiServerApiSDK.PushMessageToSingle("cf4a0d426a757a391570280e27eea097", "服务器端测试", "服务器端测试消息是否能够发送");

            return(true);
        }
Example #5
0
        public bool destroy()
        {
            executor = null;

            if (dataCache == null)
            {
                return(true);
            }

            foreach (List <BaiTanLogItemData> list in dataCache.Values)
            {
                list.Clear();
            }

            dataCache.Clear();
            dataCache = null;

            return(true);
        }
        public bool destroy()
        {
            executor = null;

            if (dataCache == null)
            {
                return(true);
            }

            foreach (List <ZhanMengShiJianData> list in dataCache.Values)
            {
                list.Clear();
            }

            dataCache.Clear();

            dataCache = null;

            return(true);
        }
Example #7
0
 public bool destroy()
 {
     _ScheduleExecutor = null;
     return(true);
 }