An Open-Source Telegram Server in C#: Four Years Later

When I decided to build an open-source Telegram server in C# four years ago, the first thingI needed was a transport. I wrote about that part inBuilding a High Performance TCP Server inC#. The post ended with a TCP echo server built around SocketAsyncEventArgs, IValueTaskSource,pooling, andSystem.IO.Pipelines. That server is now called Ferrite. The TCP implementation survived with relatively few changes, but moving bytes was only the first step. To make an actual Telegram client connect, I had to implement MTProto, generate Telegram’s TL types, dispatch hundreds of methods, and reproduce enough server-side state for the client to behave normally. Ferrite currently targets .NET 10 andTelegram
…