internal void DoHTTPGruntWork(BaseHttpServer server, Hashtable responsedata) { OSHttpResponse response = new OSHttpResponse(new HttpResponse(HttpContext, Request), HttpContext); byte[] buffer = server.DoHTTPGruntWork(responsedata, response); response.SendChunked = false; response.ContentLength64 = buffer.Length; response.ContentEncoding = Encoding.UTF8; try { response.OutputStream.Write(buffer, 0, buffer.Length); } catch (Exception ex) { m_log.Warn(string.Format("[POLL SERVICE WORKER THREAD]: Error ", ex)); } finally { //response.OutputStream.Close(); try { response.OutputStream.Flush(); response.Send(); //if (!response.KeepAlive && response.ReuseContext) // response.FreeContext(); } catch (Exception e) { m_log.Warn(String.Format("[POLL SERVICE WORKER THREAD]: Error ", e)); } PollServiceArgs.RequestsHandled++; } }