示例#1
0
 public void JobFinished(HttpJob httpJob)
 {
     lock (HttpJobs)
     {
         HttpJobs.Remove(httpJob);
     }
 }
示例#2
0
 internal void DoJob(HttpJob httpJob)
 {
     try
     {
         httpJob.DoWork();
     }
     catch (Exception exception)
     {
         httpJob.Error = exception;
         LogInfo("Listener exception: " + exception);
     }
     finally
     {
         httpJob.EndTimeOrDateTimeMax = DateTime.Now;
         //httpJob.EndTimeOrDateTimeMax = DateTime.Now;
         lock (HttpJobs)
         {
             HttpJobs.Remove(httpJob);
         }
     }
 }
示例#3
0
        internal void _listener_404(IHttpClientContext context, IHttpRequest request, IHttpResponse response)
        {
            HttpJob httpJob = new HttpJob(this, context, request, response);

            lock (HttpJobs)
            {
                HttpJobs.Add(httpJob);
            }
            // 5 second wait
            if (Monitor.TryEnter(HttpLock, waitForEachTime))
            {
                DoJob(httpJob);
                Monitor.Exit(HttpLock);
            }
            else
            {
                LogInfo("ERROR Waiting for prevoius request more than " +
                        TaskQueueHandler.GetTimeString(waitForEachTime));
                httpJob.OutOfLock = true;
                DoJob(httpJob);
            }
        }
 public void JobFinished(HttpJob httpJob)
 {
     lock (HttpJobs)
     {
         HttpJobs.Remove(httpJob);
     }
 }
 internal void DoJob(HttpJob httpJob)
 {
     try
     {
         httpJob.DoWork();
     }
     catch (Exception exception)
     {
         httpJob.Error = exception;
         LogInfo("Listener exception: " + exception);
     }
     finally
     {
         httpJob.EndTimeOrDateTimeMax = DateTime.Now;
         //httpJob.EndTimeOrDateTimeMax = DateTime.Now;
         lock (HttpJobs)
         {
             HttpJobs.Remove(httpJob);
         }
     }
 }
        internal void _listener_404(IHttpClientContext context, IHttpRequest request, IHttpResponse response)
        {
            HttpJob httpJob = new HttpJob(this, context, request, response);

            lock (HttpJobs)
            {
                HttpJobs.Add(httpJob);
            }
            // 5 second wait
            if (Monitor.TryEnter(HttpLock, waitForEachTime))
            {
                DoJob(httpJob);
                Monitor.Exit(HttpLock);
            }
            else
            {
                LogInfo("ERROR Waiting for prevoius request more than " +
                        TaskQueueHandler.GetTimeString(waitForEachTime));
                httpJob.OutOfLock = true;
                DoJob(httpJob);
            } 
        }