Пример #1
0
        protected void ProcessRequest(MonoWorkerRequest mwr)
        {
            if (mwr == null)
            {
                throw new ArgumentNullException("mwr");
            }

            if (!mwr.ReadRequestData())
            {
                EndOfRequest(mwr);
                return;
            }

            mwr.EndOfRequestEvent += endOfRequest;
            try {
                mwr.ProcessRequest();
            } catch (ThreadAbortException) {
                Thread.ResetAbort();
            } catch (Exception ex) {             // should "never" happen
                // we don't know what the request state is,
                // better write the exception to the console
                // than forget it.
                Logger.Write(LogLevel.Error, "Unhandled exception: {0}", ex);
                EndOfRequest(mwr);
            }
        }
Пример #2
0
 public void EndOfRequest(MonoWorkerRequest mwr)
 {
     try {
         mwr.CloseConnection();
     } catch {
     } finally {
         var brb = RequestBroker as BaseRequestBroker;
         if (brb != null)
         {
             brb.UnregisterRequest(mwr.RequestId);
         }
     }
 }