private void ClientMessageRecive(CMPP30Client clien, CMPP_DELIVER deliver) { if (this.MessageRecive != null) { MessageRecive(this, deliver); } }
/// <summary> /// /// </summary> /// <param name="ip"></param> /// <param name="port"></param> /// <param name="sp_id"></param> /// <param name="pwd"></param> /// <param name="service_Id"></param> /// <param name="spNumber"></param> /// <param name="sign"></param> /// <param name="log">日志输出</param> /// <param name="timeOutSecond">命令超时时间</param> /// <param name="activeTestInterval">链路检测发送间隔</param> public Cmpp30(string ip, int port, string sp_id, string pwd, string service_Id, string spNumber, string sign, Action <string> log, int timeOutSecond, int activeTestInterval) { WriteLog = new Action <string>((x) => { if (log != null) { log(string.Format("CMPP30({0})->{1}", spNumber, x)); } }); remoteAddress = ip; remotePort = port; spId = sp_id; loginPassword = pwd; serviceId = service_Id; spPhoneNumber = spNumber; if (sign != null) { operatorSign = sign; } //client clien = new CMPP30Client(ip, port, sp_id, pwd); clien.WriteLog = WriteLog; clien.StateReport = ClientStateReport; clien.UserMessageRecive = ClientMessageRecive; clien.MaxTimeOut = timeOutSecond; clien.ActiveTestInterval = activeTestInterval; }
private void ClientStateReport(CMPP30Client clien, CMPP_DELIVER_Msg_Content content) { if (this.StateReport != null) { StateReport(this, content); } }