SearchSession ProcessRequest(HttpListenerRequest HttpRequest) { String SesID = HttpRequest.QueryString["SessionID"];//TODO: HardCoded!!! SearchSession CurSession = null; if (SesID == null) { CurSession = new SearchSession(); CurSession.Start(HttpRequest.QueryString); SessionMap.Add(CurSession.GetSesID(), CurSession); } else { if(!SessionMap.TryGetValue(SesID, out CurSession)) { System.Diagnostics.Debug.WriteLine("Unknown Session (" + SesID + ")"); } } return CurSession; }
void CheckFinishedSession(SearchSession CurSession) { if (CurSession.IsFinished()) SessionMap.Remove(CurSession.GetSesID()); }