private void startSocketThread() { Ctrl.print("启动socket线程"); if (ShineSetting.useKCP) { _kcpThread = new BaseThread("kcpThread"); _kcpThread.setRunCall(kcpLoop); ThreadControl.addThread(_kcpThread); _kcpThread.start(); } if (ShineSetting.socketUseAsync) { return; } _sendThread = new BaseThread("ioSendThread"); _sendThread.setRunCall(sendLoop); ThreadControl.addThread(_sendThread); _receiveThread = new BaseThread("ioReceiveThread"); _receiveThread.setRunCall(receiveLoop); _receiveThread.setSleepTime(1); ThreadControl.addThread(_receiveThread); _sendThread.start(); _receiveThread.start(); }
/** 初始化 */ public static void init() { _mainThread = Thread.CurrentThread; _assistThread = new BaseThread("assistThread"); _assistThread.start(); addThread(_assistThread); _ioThread = new BaseThread("ioThread"); _ioThread.start(); addThread(_ioThread); }