Exemplo n.º 1
0
        public Session CreateSession(HttpServlet servlet)
        {
            lSessionCount++;
            Session newSession = new Session(lSessionCount, servlet);
            mSessionDic.Add(lSessionCount, newSession);

            return newSession;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 服务端使用的构造函数
        /// </summary>
        /// <param name="servlet"></param>
        public BinaryDataParser(HttpServlet servlet)
        {
            string strContent = servlet.getContentText();
            stream = new BinaryStream();
            mSession = SessionMgr.GetIns().CreateSession(servlet);

            stream.SetContent(Convert.FromBase64String(strContent));
        }
Exemplo n.º 3
0
 public Session(long lSessionid, HttpServlet servlet)
 {
     lSessionId = lSessionid;
     mServletOwner = servlet;
     mMsgManager = new ServerMsgManager(lSessionid, mServletOwner);
 }
Exemplo n.º 4
0
        /// <summary>
        /// 连接处理
        /// </summary>
        /// <param name="servlet"></param>
        protected void HandleDisconnect(HttpServlet servlet)
        {
            if (servlet == null || Disconnect == null)
                return;

            Disconnect(NetCommon.Net.ENet.HttpServer, servlet);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 连接处理
        /// </summary>
        /// <param name="servlet"></param>
        protected void HandleConnected(HttpServlet servlet)
        {
            if (servlet == null || Connected == null)
                return;

            Connected(NetCommon.Net.ENet.HttpServer, servlet);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 接收到数据
        /// </summary>
        /// <param name="servlet"></param>
        /// <param name="byData"></param>
        /// <param name="length"></param>
        public void ReceiveData(HttpServlet servlet, byte[] byData, int length)
        {
            if (servlet == null || Receive == null)
                return;

            Receive(NetCommon.Net.ENet.HttpServer, servlet, byData, length, 0);
        }
Exemplo n.º 7
0
 public ServerMsgManager( long lOwnerSessionId, HttpServlet servlet )
 {
     mOwnerSessionId = lOwnerSessionId;
     mServletOwner = servlet;
 }
Exemplo n.º 8
0
 /// <summary>
 /// push
 /// </summary>
 void PushServlet(HttpServlet hs)
 {
     lock (servletsLock)
     {
         processServlets.Enqueue(hs);
     }
 }