Ejemplo n.º 1
0
        private static void CompleteRequest(IISHttpContext context, Task <bool> completedTask)
        {
            // Post completion after completing the request to resume the state machine
            context.PostCompletion(ConvertRequestCompletionResults(completedTask.Result));

            // Dispose the context
            context.Dispose();
        }
Ejemplo n.º 2
0
        private static void CompleteRequest(IISHttpContext context, bool result)
        {
            // Post completion after completing the request to resume the state machine
            context.PostCompletion(ConvertRequestCompletionResults(result));

            if (Interlocked.Decrement(ref context.Server._outstandingRequests) == 0 && context.Server.Stopping)
            {
                // All requests have been drained.
                NativeMethods.HttpStopCallsIntoManaged();
                context.Server._shutdownSignal.TrySetResult(null);
            }

            // Dispose the context
            context.Dispose();
        }