private void EndRequest(OwinHttpListenerContext owinContext, Exception ex)
{
// TODO: Log the exception, if any
Interlocked.Decrement(ref _currentOutstandingRequests);
if (owinContext != null)
{
owinContext.End(ex);
owinContext.Dispose();
}
// Make sure we start the next request on a new thread, need to prevent stack overflows.
OffloadStartNextRequest();
}