Exemple #1
0
        public virtual void RegisterHttpHandler <T>(HttpMsgRouter.MsgHandler handler) where T : IProtocolHead
        {
            UInt16 appCode = 0, funcCode = 0;
            byte   flag = 0;

            GetProtoArgs <T>(out appCode, out funcCode, out flag);
            if (null == httpMsgRouter)
            {
                return;
            }

            httpMsgRouter.RegisterMsgHandler(appCode, funcCode, handler);
        }
Exemple #2
0
        public virtual void SendHttpMsg(string url, string method, HttpMsgRouter.MsgHandler callback = null, bool getOriginData = false)
        {
            if (null == httpMsgRouter)
            {
                return;
            }
            string directory = url;

            string parameters = "";
            string body       = "";

//			if ("GET" == method.ToUpper() || "DELETE" == method.ToUpper())
//			{
//				parameters = ProtoBufUtil.ToUrlParams<T>(obj);
//			}
//			else
//			{
//				body = ProtoBufUtil.ToJson<T>(obj);
//			}

            httpMsgRouter.SendMsg(method, directory, body, parameters);
        }
Exemple #3
0
 protected void UnRegisterHttpHandler <T>(HttpMsgRouter.MsgHandler handler) where T : IProtocolHead
 {
     m_owner.UnRegisterHttpHandler <T>(handler);
 }
Exemple #4
0
 public void UnRegisterHttpHandler <T>(HttpMsgRouter.MsgHandler handler) where T : IProtocolHead
 {
     network.UnRegisterHttpHandler <T>(handler);
 }