Skip to content

Network API Reference

Nalix.Network is the server-side transport engine. It manages the lifecycle of raw sockets, performs protocol-level handshakes, and provides a structured interface for high-level application routing.

Master Transport Landscape

The following diagram illustrates the ownership and handoff chain between the core network components.

flowchart TD
    subgraph Listeners[Layer 1: Entry Point]
        TCP[TcpListener]
        UDP[UdpListener]
    end

    subgraph Core[Layer 2: Logic Owner]
        Conn[Connection]
        Hub[ConnectionHub]
    end

    subgraph Transport[Layer 3: Native IO]
        SC[SocketConnection]
        STCP[SocketTcpTransport]
        SUDP[SocketUdpTransport]
    end

    subgraph Support[Layer 4: Utilities]
        TW[TimingWheel]
        SS[SessionStore]
        Lim[ConnectionGuard]
    end

    Listeners -->|Accept/Resolve| Conn
    Conn -->|Owns| SC
    Conn -->|Registers to| Hub

    SC -->|Managed By| STCP
    SC -->|Managed By| SUDP

    Hub -.->|Persists sessions| SS
    TW -.->|Monitors idle| Conn
    Lim -.->|Gatekeeps| Listeners

Progressive Reading Order

To understand the Nalix networking stack, we recommend reading the documentation in this order:

  1. Socket Connection: The lowest-level wrapper for .NET Sockets, handling Ri/Tx buffers and Layer 1 throttling.
  2. TCP Listener / UDP Listener: Entry points for accepting connections and detecting sessions.
  3. Connection: The high-level orchestrator that owns the session identity and security context.
  4. Connection Hub: The central registry for looking up and managing thousands of active connections.
  5. Timing Wheel: The high-efficiency timer used for cleaning up idle connections.

Core Areas

Connection Subsystem

Protocols & Transport

Network Options