In the previous post, we laid down the foundations of Beskar.Networking — an ultra-fast transport layer utilizing System.IO.Pipelines and PinnedBlockMemoryPool to move raw bytes over sockets with zero GC pressure.
But raw transport is only half the battle. If you want to build a fully fledged server framework, you need to handle application-layer protocols. For this project, that protocol is MQTT (supporting both MQTT v3.1.1 and MQTT v5.0 specifications).
Moving from raw streams to a stateful message broker introduces a mountain of high-allocation operations:
MQTT packet parsing & encoding: Serializing headers, user properties, payloads, and variable integers.
Subscription matching (Trie): Figuring out which client sessions match a published topic filter (like sensors/+/temperature or factory/#) under high concurrency.






