public void SendMessage(RqId requestId, IRequest request) { if (null == mConnection) { Logger.LogError("当前没有连接,无法发送消息 " + requestId.ToString()); return; } mConnection.SendMessage(requestId, request); }
public static void RegisterHandlerFunc(RqId requestId, System.Action <MyPeer, OperationRequest> invokeFunc) { byte rqIdByte = (byte)requestId; if (mPeerHandlerDic.ContainsKey(rqIdByte)) { LBLogger.Error(LogTag, "注册重复的事件处理 " + requestId.ToString()); return; } mPeerHandlerDic[rqIdByte] = invokeFunc; }
public void SendMessage(RqId requestId, IRequest request) { mPeer.OpCustom((byte)requestId, request.Serialization(), true); }