Can I set the Request Queue Name when using System.Net.HttpListener

70 Views Asked by At

I have a service that listens for HTTP messages via HTTP.SYS. It uses the System.Net.HttpListener class:

this._httpListener = new HttpListener();
foreach(var prefix in _addressPrefixes.Select(ChannelIdToUrlPrefix))
{
    _httpListener.Prefixes.Add(prefix);
}
_httpListener.Start();

I would like to set the name of the HTTP Listening Queue so I can identify it easily in the Performance Monitor. I can't see how to do this.

As an example of where I can see how to do this, I have another service which uses AspNet Core. This does allow me to set the name, via the RequestQueueName option.

builder.UseHttpSys(
    options =>
    {
        //
        // Set all the other options as well
        //          
            options.RequestQueueName = "My Custom Name";
    }
);

Is there any way I can set the queue name when I am simply using the HttpListener class?

0

There are 0 best solutions below