I just realized that ASP.NET Core apps are not pure CLR apps - they always depend on additional binary libraries: libuv through Kestrel or, probably way less used, http.sys.
I find this surprising as I would have thought there to be already enough networking api under .NET Core (and so .NET Standard) to make a decent performing web server with asynchronous IO purely in .NET - yet they didn't go that route.
So:
WebClient
, HttpRequest
or HttpClient
wouldn't use libuv, correct?EDIT:
I had a look at the Kestrel sources and besides an assembly called Microsoft.AspNetCore.Server.Kestrel.Transport.Libuv
there also is an assembly called Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets
. The corresponsing NuGet package for the sockets assembly is in preview only though. (The sockets assembly doesn't depend on libuv of course.)
Earlier versions of ASP.NET Core used Libuv as an implementation detail of how asynchronous input and output was performed. In ASP.NET Core 2.0, an alternative, Socket-based transport was developed. In ASP.NET Core 2.1, Kestrel switched to using the Socket -based transport by default.
Kestrel used as an edge server without a reverse proxy server doesn't support sharing the same IP and port among multiple processes. When Kestrel is configured to listen on a port, Kestrel handles all of the traffic for that port regardless of requests' Host headers.
It is included by default as internal server in ASP.NET Core. Kestrel can be used, by itself as an edge server i.e Internet-facing web server that can directly process the incoming HTTP requests from the client. In Kestrel, the process used to host the app is dotnet.exe.
With support for Unix sockets, Kestrel is compatible with most load balancers, including Nginx. This makes it ideal for use in containers, either under Linux or in a Windows container.
In ASP.NET Core 2.1, Kestrel switched to using the Socket -based transport by default. Libuv support was maintained for compatibility reasons. At this point, use of the Socket -based transport is far more common than the Libuv transport. Consequently, Libuv support is marked as obsolete in .NET 5 and will be removed entirely in .NET 6.0.
Earlier versions of ASP.NET Core used Libuv as an implementation detail of how asynchronous input and output was performed. In ASP.NET Core 2.0, an alternative, Socket -based transport was developed.
Kestrel is a cross-platform web server for ASP.NET Core. Kestrel is the web server that's included by default in ASP.NET Core project templates. Kestrel is supported on all platforms and versions that .NET Core supports.
At this point, use of the Socket -based transport is far more common than the Libuv transport. Consequently, Libuv support is marked as obsolete in .NET 5 and will be removed entirely in .NET 6.0.
The plan is to switch to Sockets but it may not make it in time for Net Core 2.1 but could be available for the public.
It seems that as of December 2017 they had to switch back from Sockets to Libuv due to performance issues:
see https://github.com/aspnet/KestrelHttpServer/issues/2220
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