John
John

Reputation: 7049

ASP.NET Core and Kestrel design decision: Why do they use libuv?

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:

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.)

Upvotes: 7

Views: 4103

Answers (1)

Max Quagliotto
Max Quagliotto

Reputation: 86

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

Upvotes: 7

Related Questions