Drain stop Katana

Jun 17, 2014 at 4:55 PM
Is there a way to drain stop the server when OWIN & Katana? In particular, I want to stop accepting new requests (ideally by not listening for the connections) wait for any in-flight requests to complete, and then finally shut down.

I thought I might be able to count in-flight requests using a middleware, and use that to wait for them to complete. But I can't find a way to stop listening for new requests. It appears that calling Dispose() on the result from WebApp.Start() causes all in-flight requests to be immediately killed, which is undesireable. I can't find any other way to stop the listener. Is there some other way to do this?
Coordinator
Jun 17, 2014 at 5:02 PM