API Reference
On this page
Nalix API documentation is organized by package boundary and runtime responsibility so you can move from contracts (Nalix.Abstractions) to execution (Nalix.Runtime, Nalix.Network) and then to client transport (Nalix.SDK) without mixing concerns.
Where to start
If you’re looking for the core interfaces and classes that drive Nalix:
- Packet contracts & attributes — Common API
- Handlers, routing & metadata — Runtime Routing
- Middleware pipelines — Runtime Middleware
- TCP/UDP transport & protocols — Network API
- Client sessions & requests — SDK API
Source Mapping
src/Nalix.Abstractionssrc/Nalix.Environmentsrc/Nalix.Codecsrc/Nalix.Frameworksrc/Nalix.Runtimesrc/Nalix.Networksrc/Nalix.Hostingsrc/Nalix.SDKanalyzers/Nalix.Analyzersanalyzers/Nalix.Analyzers.CodeFixanalyzers/Nalix.Analyzers.CodeGen
Why This Structure Exists
Nalix is split into focused packages with explicit layering:
Nalix.Abstractionsdefines shared contracts and attributes.Nalix.Environmentprovides foundational memory types, configuration, and environment primitives.Nalix.Codechandles serialization, built-in frames, and data transforms.Nalix.Frameworkprovides reusable runtime services, instance management, and tasking.Nalix.Runtimeturns packets into handler execution and provides reusable middleware/throttling components.Nalix.Networkowns listeners, connections, protocols, and session stores.Nalix.Hostingadds host/builder composition on top of runtime + network.Nalix.SDKprovides client-side transport sessions and extension APIs.
This keeps server runtime internals, transport lifecycle, and client APIs independently evolvable.
Package Responsibility Matrix
| Package | Primary responsibility | Use when | Avoid when |
|---|---|---|---|
Nalix.Abstractions | Core interfaces/enums/attributes | You need shared contracts across packages | You need concrete runtime behavior |
Nalix.Environment | Memory, Config, IO, Clock | You need zero-allocation memory primitives | You only need high-level networking |
Nalix.Codec | Serialization, Frames, Transforms | You need to pack/unpack data or register packets | You only need transport lifecycle |
Nalix.Framework | Runtime services and identifiers | You need instance management or task scheduling | You only need pure client transport |
Nalix.Runtime | Packet dispatch and middleware | You are building handler execution pipelines | You only need socket listener primitives |
Nalix.Network | Connection + listener + protocol | You are implementing server transport loops | You only need pure client transport |
Nalix.Hosting | Host-style startup composition | You want builder-driven server bootstrapping | You prefer manual wiring |
Nalix.SDK | Client transport and sessions | You build Nalix clients | You implement server listeners |
Progressive API Path
- Start with Common contracts and connection/session abstractions.
- Learn packet runtime flow in Runtime API.
- Move to transport lifecycle in Network API.
- For clients, continue with SDK API.
- For production startup composition, use Hosting API.
Suggested Architecture Diagrams
- Dispatch sequence:
IBufferLease -> PacketRegistry -> PacketContext<TPacket> / IPacketContext<TPacket> -> handler. - Server layering: Listener (
Nalix.Network) above runtime dispatch (Nalix.Runtime) and shared contracts (Nalix.Abstractions). - Client-server handshake lifecycle using
Nalix.SDK.Transport.Extensions+ runtime handlers.