コード例 #1
0
ファイル: TransportManager.cs プロジェクト: moke666/neutrino
        static TransportManager()
        {
            var m = new ExecutorWorker("networkManager");

            m.Init();
            worker = m;
            worker.RegisterEventHandler((int)NetworkWorkerEvent.QUEUE_SEND_MSG, OnQueueSendMsg);
            worker.RegisterEventHandler((int)NetworkWorkerEvent.CONTINUE_SEND_MSG, OnContinueSendMsg);
            worker.RegisterEventHandler((int)NetworkWorkerEvent.ADD_NETWORK_CONN, OnAddNetworkConn);
            worker.RegisterEventHandler((int)NetworkWorkerEvent.REMOVE_NETWORK_CONN, OnRemoveNetworkConn);
        }
コード例 #2
0
        public static Executor Get(string name)
        {
            var m = workerMap.GetOrAdd(name, (string name) => {
                ExecutorWorker worker = new ExecutorWorker(name);
                if (Interlocked.CompareExchange(ref inited, 1, 1) == 1)
                {
                    worker.Init();
                }
                return(worker);
            });

            return(m);
        }
コード例 #3
0
 internal void Init(ExecutorWorker m)
 {
     this.m = m;
 }