Meshpocalypse Semantic
    Preparing search index...

    Class NextHopRouter

    Uses learned routes for efficient delivery; falls back to flooding when no route is known. Sits above FloodingRouter in the middleware pipeline.

    The NextHopRouter doesn't actually re-route packets in the middleware — it provides the send-side path determination. On the receive side it simply passes through (all messages should be delivered locally if they reached this node).

    Spec ref: SPEC-004

    Index

    Constructors

    Properties

    routingTable: RoutingTable

    Methods

    • Middleware for the receive pipeline. NextHopRouter is pass-through on receive — if the packet reached us, it should be delivered. Route learning happens via ACK handling in ReliableRouter, not here.

      Returns (packet: AgentMeshPacket) => boolean

    • Record a successful delivery to update the routing table.

      Parameters

      • destination: string
      • via: string
      • hopCount: number = 1

      Returns void