Nalix¶
Nalix is a real-time TCP and UDP networking framework for .NET 10. It provides a unified packet model shared between client and server, zero-allocation hot paths, shard-aware dispatch pipelines, and middleware-driven packet processing with production-grade transport infrastructure.
What does building with Nalix look like?¶
A typical Nalix application involves five clean steps:
- Define packets: Create shared contracts using
[Packet]attributes. - Register handlers: Map packets to logic via fluent routing.
- Configure transport: Select TCP/UDP and set security policies.
- Run the server: Start the host using the
NetworkApplicationBuilder. - Connect using SDK: Leverage the client-side session to communicate.
Quickstart
See Quickstart for a full, copy-pasteable example.
🚀 Recommended Path¶
If you're new to Nalix, follow this path to go from zero to production-ready:
- Introduction — Understand the design philosophy and mental model.
- Architecture — Explore the layered component system.
- Quickstart — Build your first Ping/Pong server in minutes.
- End-to-End Guide — Move beyond basics with a full feature implementation.
- Middleware — Learn how to secure and scale your traffic.
Next
Explore the API Reference as needed.
Zero-alloc hot path¶
Pooled buffers, pooled contexts, and frozen lookups reduce GC pressure for sustained low-latency traffic.
Shard-aware dispatch¶
Worker distribution prevents head-of-line blocking and scales packet handling across logical cores.
Fault Isolation¶
Handler exceptions are trapped and logged without affecting other connections or crashing the worker loops.
Why Nalix¶
| Capability | How Nalix delivers it |
|---|---|
| Unified packet model | Define packet types once in a shared assembly. Both Nalix.Network (server) and Nalix.SDK (client) consume the same contracts, attributes, and serialization metadata. |
| Zero-allocation data paths | Pooled buffers (BufferLease), pooled packet contexts, frozen registry lookups (FrozenDictionary), and function-pointer–based deserialization eliminate GC pressure on hot paths. |
| Shard-aware dispatch | PacketDispatchChannel distributes work across multiple worker loops to prevent head-of-line blocking. Workers scale to logical CPU core count. |
| Middleware pipeline | Production-grade packet middleware system (MiddlewarePipeline) for application policy (permissions, rate limiting, timeouts) and observability. |
| Production transport | Built-in connection guarding, token-bucket rate limiting, policy-based throttling, concurrency gates, and timing-wheel–based idle timeout management. |
Architecture Overview¶
Nalix organizes networking into four clean layers.
graph TD
subgraph Client ["Nalix.SDK"]
Session["TransportSession / TcpSession"]
end
subgraph Server ["Nalix.Hosting"]
Builder["NetworkApplicationBuilder"]
Host["NetworkApplication"]
end
subgraph Runtime ["Nalix.Runtime"]
Dispatch["PacketDispatchChannel"]
Middleware["Middleware Pipeline"]
end
subgraph Base ["Nalix.Abstractions / Framework"]
Registry["PacketRegistry"]
Pool["BufferPoolManager"]
Crypto["FrameCipher / FrameCompression"]
end
Session -- "TCP / UDP" --> Host
Host --> Dispatch
Dispatch --> Registry
Dispatch --> Middleware
Middleware --> Handlers["Handler Logic"]
Start Here¶
Choose the path that matches your role.
- Introduction — Design philosophy and mental model
- Installation — Package selection and prerequisites
- Quickstart — Build a Ping/Pong server end-to-end
- Architecture — Layered component overview
- Server Blueprint — Production-oriented project structure
- Introduction — Design philosophy and mental model
- Installation — Package selection and prerequisites
- Quickstart — Connect a client to your first server
- Nalix.SDK — Client transport sessions and request helpers
- TCP Session — Detailed session API
- Selecting Building Blocks — Decision guide
- Middleware — Middleware Pipeline and lifecycle
- Custom Middleware Guide — End-to-end walkthrough
- Custom Metadata Provider — Convention-based metadata
- Architecture — System design and component boundaries
- Packet System — Serialization and unified packet model
- Binary Specification — Detailed wire format and layout rules
- Packet Lifecycle — Request path from socket to handler
- Error Reporting — Runtime and protocol signaling
- Glossary — Term definitions
Core Packages¶
| Package | Purpose |
|---|---|
| Nalix.Network | TCP/UDP listeners, connections, protocol logic, and transport infrastructure |
| Nalix.Runtime | Packet dispatch, middleware execution, handler compilation, and session resume |
| Nalix.SDK | Client-side transport sessions, request/response helpers, and handshake flows |
| Nalix.Framework | Configuration, service registry, serialization, packet registry, pooling, compression, and identifiers |
| Nalix.Hosting | Fluent builder and application lifecycle for server bootstrap |
| Nalix.Abstractions | Shared contracts, packet attributes, middleware primitives, and connection abstractions |
For the full package map, see Packages Overview.
Nalix is built by PPN Corporation. Licensed under Apache 2.0.