Example #1
0
        /// <summary>
        /// 测试用的发送协议
        /// </summary>
        /// <param name="body">要发送的网络协议</param>
        /// <param name="rspProtoId">期望收到的响应Id</param>
        /// <param name="timeOutHandler">协议响应超时的处理处理方法</param>
        public void SendTcpClientMessage(ProtoID rspProtoId, ProtoBody body, Action timeOutHandler, bool isShowWaiting = false)
        {
            //protoTimes[rspProtoId] = Time.realtimeSinceStartup;
            //timeOutHandlers[rspProtoId] = timeOutHandler;
            TimeOutData data = new TimeOutData(rspProtoId, timeOutHandler);

            int dataIndex = timeOutHandlers.IndexOf(data);

            if (dataIndex > 0)
            {
                timeOutHandlers[dataIndex].StartTime = Time.realtimeSinceStartup;
            }
            else
            {
                timeOutHandlers.Add(data);
            }

            SendTcpClientMessage(body);
        }
Example #2
0
 public int AddProcess(ProtoBody body)
 {
     return(AddProcess(new Process(body)));
 }
Example #3
0
 public Process(ProtoBody body)
 {
     Specification = body;
     processID     = ProtoID.GetProtoIDByBody(body);
 }
Example #4
0
 public void SendTcpClientMessage(ProtoBody protoBody)
 {
     networkCtrl.SendMessage(mTcpClientSessionId, protoBody);
 }
Example #5
0
 public void SendTcpServerMessage(ProtoBody protoBody)
 {
     networkCtrl.SendMessage(mTcpServerSessionId, protoBody);
 }
Example #6
0
        public void SendTcpClientMessage(ProtoID rspProtoId, ProtoBody protoBody)
        {
            Protocol proto = new Protocol(rspProtoId, protoBody);

            networkCtrl.SendMessage(mTcpClientSessionId, proto);
        }