route method

void route(
  1. NodeId from,
  2. NodeId to,
  3. Frame frame
)

Delivers frame from from to the single addressed node to.

Mirrors the unicast semantics of the real LAN transport: a frame is delivered only to its target. Unknown targets are silently dropped.

Implementation

void route(NodeId from, NodeId to, Frame frame) {
  if (_paused) {
    _queued.add(() => _nodes[to]?.injectFrame(from, frame));
    return;
  }
  _nodes[to]?.injectFrame(from, frame);
}