Ejemplo n.º 1
0
        /// <summary>
        /// 根据命令类型返回相关响应类
        /// </summary>
        /// <param name="header"></param>
        /// <param name="bodyBytes"></param>
        /// <returns></returns>
        private static BaseMsg GetSocketRespByHeader(MsgHeaderEnt header, byte[] bodyBytes)
        {
            //  todo 完善信息
            BaseMsg resp = null;

            switch (header.CommandType)
            {
            case CommandType.ConnectResp:
                resp = new ConnectResp(bodyBytes, header);
                break;

            //case CommandType.DeliverResp:
            //    resp = new DeliverResp(bodyBytes, header);
            //    break;
            case CommandType.SubmitResp:
                resp = new SubmitResp(bodyBytes, header);
                break;

            case CommandType.ActiveTest:
                resp = new ActiveTestReq(bodyBytes, header);
                break;

            case  CommandType.ActiveTestResp:
                resp = new ActiveTestResp(bodyBytes, header);
                break;

            default:
                resp = new UnKnowResp(bodyBytes, header);
                break;
            }
            return(resp);
        }
Ejemplo n.º 2
0
 private static void _ctl_SubmitRespInterface(SubmitResp sm)
 {
     try
     {
         if (_statusChanged != null)
         {
             if (sm.Result != SubmitResultEnum.SUBMIT_OK)
             {
                 _statusChanged(sm.SequenceID, "0|Submit failed:" + sm.Result);
             }
             else
             {
                 _statusChanged(sm.SequenceID, "3|Submited:" + sm.Result);
             }
         }
     }
     catch
     {
     }
 }