public void WaitForConnections()
 {
     while (isNeeded)
     {
         try
         {
             hlc = hl.GetContext();
         }
         catch
         {
             isNeeded = false;
             return;
         }
         if (hlc.Request.IsWebSocketRequest)
         {
             WSINOUTHandler wsioh = new WSINOUTHandler(this, hlc, Frm);
             wsioh.OnFinished += ws_OnFinished;
             wsIOHandlerList.Add(wsioh);
             new TaskFactory().StartNew(wsioh.DoWSServeClientPostDataIn);
         }
         else
         {
             INOUTHandler ioh = new INOUTHandler(this, hlc);
             ioh.OnFinished += Ioh_OnFinished;
             IOHandlerList.Add(ioh);
             new TaskFactory().StartNew(ioh.DoServeClientDataIn);
         }
     }
 }
 private void Ioh_OnFinished(INOUTHandler sender)
 {
     sender.tIOWriteTimer.Change(-1, -1);
     sender.bInBuff = null;
     sender.hlcIO   = null;
     sender.outWriteList.Clear();
     sender.outWriteList = null;
     IOHandlerList.Remove(sender);
 }
 public PageParser(INOUTHandler parentHandler)
 {
     parent = parentHandler;
 }