private void AC_ReceiveMsgCallBack(Result result) { if (!BlockKey.IsBlock(result.data)) { LogUtil.DebugFormat("收到[{0}]:{1}", result.ipEndPoint, result.data); } OrderCode code = result.data.code; if (code == OrderCode.ClientRquest) { Data _data = new Data() { code = OrderCode.ServerResponse, msg = "success", }; _server.Send(_data, result.ipEndPoint); _server.Send(new Data(OrderCode.HeartBeat), result.ipEndPoint); addClient(result.ipEndPoint); } if (receiveMsgCallBack != null) { receiveMsgCallBack(result); } }
/// <summary> /// 处理接收到的信息 /// </summary> /// <param name="result"></param> /// <param name="udp"></param> private void AC_ReceiveMsgCallBack(Result result) { if (!BlockKey.IsBlock(result.data)) { LogUtil.DebugFormat("收到[{0}]:{1}", result.ipEndPoint, result.data); } OrderCode code = result.data.code; if (code == OrderCode.ServerResponse) { conSuccess(result); } if (receiveMsgCallBack != null) { receiveMsgCallBack(result); } }