标签:
这是一段代码
using System; using PbRPC.Data; namespace PbRPC.Core { public class PbRPCNetwork { private static void SendMsg(byte[] data) { //todo:发送给服务器 } private static void OnReciverMsg(byte[] data) { var res = PbConvert.ToIns<RPCResponse>(data); if (res.Error != null)//error { //todo:error } else { if (res.ID <= 1000) //notify { //todo:notify } else { } } } private static int s_id = 1001; public static void CallRPC(Require require) { var arg = require.Arg; var method = require.Service; var service = method.Target.GetType().Name; var mname = method.Method.Name; var data = PbConvert.ToBytes(arg); var rpcrequire = new RPCRequire { Data = data, ID = s_id, API = service, Method = mname }; var req = PbConvert.ToBytes(rpcrequire); SendMsg(req); s_id++; } } }
表格测试 | 表格测试 |
表格测试 | 表格测试 |
标签:
原文地址:http://www.cnblogs.com/StarOfWorld/p/5400765.html