protected override void HandleUnknownRequest(ProtocolRequestBase requestInfo) { try { //解析并派发 ProtocolAnalysisService.AnalysisAndDispatchMessage(this, requestInfo); } catch (Exception e) { Debug.LogError("AnalysisAndDispatchMessage :" + requestInfo.Key + "\nException: " + e.ToString()); } }
void process_recv_queue() { mRecvQueue.Switch(); while (!mRecvQueue.Empty()) { var buf = mRecvQueue.Pop(); mKcp.Input(buf); mNeedUpdateFlag = true; for (var size = mKcp.PeekSize(); size > 0; size = mKcp.PeekSize()) { var buffer = new byte[size]; if (mKcp.Recv(buffer) > 0) { //evHandler(buffer); //这里开始解包 try { //解析并派发 ByteArray ba = new ByteArray(); ba.WriteALLBytes(buffer); ProtocolRequestBase msg = Analysis(ba); ProtocolAnalysisService.AnalysisAndDispatchMessage(this, msg); } catch (Exception e) { Debug.LogError("AnalysisAndDispatchMessage :\nException: " + e.ToString()); } } } } }
protected override void HandleUnknownRequest(ProtocolRequestBase requestInfo) { //解析并派发 ProtocolAnalysisService.AnalysisAndDispatchMessage(this, requestInfo); }