andrehrferreira / bench-sockets-csharp

C# implementation for Websocket, TCP and UDP performance testing
0 stars 0 forks source link

Pipelines to TCP and AspNetCore to WebSockets #1

Open MUN1Z opened 2 months ago

MUN1Z commented 2 months ago

You can get a significant improvement of TCP performance using the new Dotnet pipeline concept, the idea is to write and read packages at the same time, each with your pipeline, similar to Java's Netty Network Framework. By standard the native dotnet socket does not implement this concept, but we already have libs that help the use of pipelines for sockets, if you don't want to write one manually: https://github.com/mgravell/pipelines.sockets.unofficial

If you want to see a real example of use, we use the MU Emulator: https://github.com/munique/openmu

Already on the WebSocket, you can use the AspNetCore itself, just enable the use of WebSocket in it, the implementation of its WebSocket is much more performic than the C# default WebSocket class, because the AspNetCore under the cloth it implements all this Pipeline concept in Kestrel, no wonder AspNetCore is always well positioned in the performance test rankings/stress of Backend when compared to other languages.

C# can be very performic when we talk about network, but not using the basic of socket's standard classes.

andrehrferreira commented 2 months ago

Is everything ok? Can you upload a PR for us with these changes? Thanks for the information =)