Running ASP.NET WebApi I would like to set the HTTP request queue length.
I found some blog indicating this should be possible on OwinHttpListener and also in the msdn documentation .
So I used this approach to get the OwinHttpListner
public void Configuration(IAppBuilder appBuilder)
{
HttpConfiguration config = new HttpConfiguration();
var owinListenerName = "Microsoft.Owin.Host.HttpListener.OwinHttpListener";
var owinListener = (OwinHttpListener)appBuilder.Properties[owinListenerName];
// more code...
}
But the method SetRequestQueueLimit was not there. Using ILSpy also showed that there is no such internal method on that class.
I'm using nuget package Microsoft.Owin.Host.HttpListener 2.0.2
What am I missing here?
I found out that there was a later version available so I did an update of all my nuget packages which updated the package Microsoft.Owin.Host.HttpListener to version 3.0.1 and then the method was present.
Using netsh like:
netsh http show servicestate
verifies that the value of the request queue was actually updated.
I think it was because I originally installed the package Microsoft.AspNet.WebApi.OwinSelfHost which had a dependency on Microsoft.Owin.Host.HttpListener 2.0.2 or higher which was the reason I got the old version.
Hopefully someone else will be helped by this...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With