Raven.Database.Server.HttpServer.GetContext C# (CSharp) Méthode

GetContext() private méthode

private GetContext ( IAsyncResult ar ) : void
ar IAsyncResult
Résultat void
		private void GetContext(IAsyncResult ar)
		{
			IHttpContext ctx;
			try
			{
				ctx = new HttpListenerContextAdpater(listener.EndGetContext(ar), DefaultConfiguration);
				//setup waiting for the next request
				listener.BeginGetContext(GetContext, null);
			}
			catch (Exception)
			{
				// can't get current request / end new one, probably
				// listner shutdown
				return;
			}
			
			if (concurretRequestSemaphore.Wait(TimeSpan.FromSeconds(5)) == false)
			{
				HandleTooBusyError(ctx);
				return;
			}
			try
			{
				Interlocked.Increment(ref physicalRequestsCount);
				HandleActualRequest(ctx);
			}
			finally
			{
				concurretRequestSemaphore.Release();
			}
		}