/// <summary> /// 处理数据 /// </summary> /// <param name="content"></param> private void DealData(MsgChangedEventArgs e) { int len = e.Length; if (len <= 0) { e.Client.Closed = true; return; } else { string httpreq = Encoding.UTF8.GetString(e.Content); HandlerBusinuess hb=new HandlerBusinuess(); List<string[]> reqArrs = hb.AnalyseHttpRequest(httpreq); if (reqArrs != null && reqArrs.Count > 0) { hb.HandlerContent(e.Client,reqArrs,GetRootPath()); e.Client.buffer = new byte[0]; e.Client.tempbuffer = new byte[1024]; e.Client.length = 0; e.Client.capacity = 0; } } }
/// <summary> /// 初始化数据 /// </summary> private void InitData() { HandlerBusinuess hb = new HandlerBusinuess(); string rootPath = GetRootPath(); XmlHelper xmlHelper = new XmlHelper(); XmlNode node = xmlHelper.GetServerContext(rootPath + "\\conf\\server.xml"); string docBase = node.Attributes["docBase"].Value; string file = node.Attributes["default"].Value; Init.Instance.DocBase = docBase; }