/// <summary> /// 当接受到消息时的回调函数 /// </summary> /// <param name="ar"></param> public virtual void OnRecvMsgCallBack(IAsyncResult ar) { try { int count = _clientSocket.EndReceive(ar); //处理消息,然后转发给回调函数 _msg.AnalysisMsg(count, OnAnalysisMsgCallBack); StartRecv(); } catch (Exception) { Close(); } }