HttpListener is a managed "client" for the Windows http.sys kernel module (similar to IIS is also a client). This version of this module that handles HTTP / 2 is apparently only available in Win10 / IE . If you are working in Win10 and an HTTP / 2 connection is made, it will most likely look the same as the HttpListener , since the interface for the http.sys driver abstracts the protocol for HttpListener clients. If something else, it will be an HttpListenerResponse.ProtocolVersion showing HTTP / 2.
If you look at the source of HttpListener , then the http.sys interface will be blob-oriented, simply subscribing to requests and receiving request data in one large blob. This blob forms the basis of the HttpListenerContext managed class, which has request and response data represented as properties. HttpListenerResponse sends the response through http.sys , breaking the data into headers and chunks of data that it provides through the OutputStream property. If multithreading is supported, this public API must change. This is currently not supported, and I assume that they will not change this API, and if HttpListener is supported by HTTP / 2, it will completely abstract HTTP / 2 or provide some kind of WriteAsync multiplexing method at this higher level. It looks like you want to write directly against http.sys in order to take advantage of the lower level protocol.
codekaizen
source share