Search code examples
.netsocketsasp.net-corelibuvasp.net-core-2.1

libuv vs sockets in asp.net core 2.1


As of ASP.NET Core 2.1.0-preview2 Microsoft has changed libuv to sockets.

Why haven't they used Sockets in the first place?

Is there a same implication of sockets in every operating system?

Is sockets are faster then libuv?

this is the source


Solution

  • Why haven't they used Sockets in the first place?

    Back then, sockets in .NET Core were too slow. That's way libuv was chosen. And maybe because libuv was "state of the art" at that point in time.

    Later they decided to dogfood their own implementations (sorry I can't find the github-issue that points that out), hence sockets were improved and so it makes sense to use sockets instead of a native dependency like libuv.

    Is sockets are faster then libuv?

    See Announcing .NET Core 2.1 Preview 1 section "Sockets Performance and HTTP Managed Handler" for info.