Esempio n. 1
0
        protected override void ProcessComet(object cometInfoObj)
        {
            CometInfo      cometInfo = cometInfoObj as CometInfo;
            HttpConnection conn = (HttpConnection)cometInfo.Connection;
            bool           keepAlive = false, header_sent = false;

            try {
                object result = cometInfo.Handler(cometInfo);
                ProcessResponse(conn, cometInfo.Request, cometInfo.Response, result, ref keepAlive, ref header_sent);
            } catch (Exception e) {
                ProcessInternalError(conn, cometInfo.Request, cometInfo.Response, header_sent, e, ref keepAlive);
            }
            TerminateApplication(conn, keepAlive);
        }
Esempio n. 2
0
        void StartApplication(IHttpRequest req, HttpConnection conn, Encoding encoding, out bool keepAlive, out CometInfo cometInfo)
        {
            bool header_sent          = false;
            HttpResponseHeader header = new HttpResponseHeader(req);

            keepAlive = header.GetNotNullValue(HttpHeaderNames.Connection).ToLower().Equals("keep-alive");
            cometInfo = null;

            try {
                object result = _app.Process(this, req, header);
                cometInfo = result as CometInfo;
                if (cometInfo != null)
                {
                    return;
                }
                ProcessResponse(conn, req, header, result, ref keepAlive, ref header_sent);
            } catch (Exception e) {
                ProcessInternalError(conn, req, header, header_sent, e, ref keepAlive);
            }
        }