public static void Main(string[] args) { FastClient client = new FastClient(); Module1 module1 = new Module1(client); client.Connect("127.0.0.1", 9000); module1.addRspHandle = delegate(Module1.AddRsp addRsp) { Console.WriteLine("----addRsp C1: " + addRsp.C); }; Module1.AddReq addReq = new Module1.AddReq(); addReq.A = 1; addReq.B = 2; module1.SendAddReq(addReq); for (;;) { client.Process(); System.Threading.Thread.Sleep(5000); } }
public Module1(FastClient c) { this.client = c; this.client.registHandle((byte)ServiceID.ServiceID_Module1, (byte)Module1.MessageID.MsgID_Add, this.handleAdd); }