Network manager: implement packet dispatch and simulator lifecycle #53

Closed
opened 2026-08-08 08:19:16 +00:00 by hugo · 1 comment
Owner

Objective

Implement packet callback dispatch, simulator collections/state, connection setup, enable/disable, keepalive, disconnect, and handler registration.

Deliverables

  • Preserve callback ordering/filtering, current-simulator selection, circuit codes, seed state, disconnect reasons, and thread-safety semantics.
  • Do not execute user callbacks while holding internal locks.
  • Expose typed subscriptions/guards matching mapped APIs.

Validation

  • Network/simulator/dispatch tests pass.
  • Concurrent registration/removal and disconnect scenarios are deterministic.
  • No callback or task retains a dropped GridClient.

Prerequisite

Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative.

Project constraints

  • Native Rust networking only; no C# bridge, helper service, subprocess, or fallback.
  • Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets.
  • Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
## Objective Implement packet callback dispatch, simulator collections/state, connection setup, enable/disable, keepalive, disconnect, and handler registration. ## Deliverables - Preserve callback ordering/filtering, current-simulator selection, circuit codes, seed state, disconnect reasons, and thread-safety semantics. - Do not execute user callbacks while holding internal locks. - Expose typed subscriptions/guards matching mapped APIs. ## Validation - Network/simulator/dispatch tests pass. - Concurrent registration/removal and disconnect scenarios are deterministic. - No callback or task retains a dropped GridClient. ## Prerequisite Wire codegen and the foundational implementation milestones are complete; the fixed API/test gates remain authoritative. ## Project constraints - Native Rust networking only; no C# bridge, helper service, subprocess, or fallback. - Keep mapped APIs and translated assertions fixed, use bounded resources, and never log secrets. - Validate offline with deterministic fake servers before live-grid use and update docs/coverage evidence.
hugo added this to the 08 - Networking and client lifecycle milestone 2026-08-08 08:19:16 +00:00
hugo added the enhancement label 2026-08-08 08:19:16 +00:00
Author
Owner

Implemented and pushed in commit d298b4f.

The native Rust implementation now provides ordered packet and CAPS dispatch, conservative asynchronous callback behavior, typed RAII subscription guards, synchronized simulator collections, circuit/seed/current-simulator state, cancellable connection setup, reliable UseCircuitCode ACK waiting, region-handshake reply state, CAPS EnableSimulator, UDP DisableSimulator and KickUser handling, StartPingCheck ACK flushing and pong replies, two-interval keepalive detection, deterministic disconnect/shutdown reasons, and runtime-neutral async compatibility methods. All queues and workers are bounded, callbacks are invoked from lock-free snapshots, and internal callbacks/tasks use weak ownership so they do not retain a dropped GridClient. Documentation and generated API coverage were updated.

Verification completed in isolation:

  • cargo test -p libremetaverse --test network_manager: 12 passed
  • cargo test -p libremetaverse --test udp_transport: 12 passed
  • cargo test -p libremetaverse --test packet_wire: 6 passed
  • client-retention unit test: passed
  • cargo check --workspace --all-targets --locked -j 1: passed
  • Clippy with warnings denied for libremetaverse, libremetaverse-types, and codegen: passed
  • generator determinism, API coverage, API compile fixture, rustdoc, formatting, and diff checks: passed

The fake simulators cover connection reuse, circuit ACKs, handshake replies and timeout behavior, immediate pending-ACK flush before pong, enable/disable, current/seed selection, callback ordering/filtering/reentrancy, concurrent registration/removal and disconnect, and keepalive shutdown without requiring a live grid.

Implemented and pushed in commit d298b4f. The native Rust implementation now provides ordered packet and CAPS dispatch, conservative asynchronous callback behavior, typed RAII subscription guards, synchronized simulator collections, circuit/seed/current-simulator state, cancellable connection setup, reliable UseCircuitCode ACK waiting, region-handshake reply state, CAPS EnableSimulator, UDP DisableSimulator and KickUser handling, StartPingCheck ACK flushing and pong replies, two-interval keepalive detection, deterministic disconnect/shutdown reasons, and runtime-neutral async compatibility methods. All queues and workers are bounded, callbacks are invoked from lock-free snapshots, and internal callbacks/tasks use weak ownership so they do not retain a dropped GridClient. Documentation and generated API coverage were updated. Verification completed in isolation: - cargo test -p libremetaverse --test network_manager: 12 passed - cargo test -p libremetaverse --test udp_transport: 12 passed - cargo test -p libremetaverse --test packet_wire: 6 passed - client-retention unit test: passed - cargo check --workspace --all-targets --locked -j 1: passed - Clippy with warnings denied for libremetaverse, libremetaverse-types, and codegen: passed - generator determinism, API coverage, API compile fixture, rustdoc, formatting, and diff checks: passed The fake simulators cover connection reuse, circuit ACKs, handshake replies and timeout behavior, immediate pending-ACK flush before pong, enable/disable, current/seed selection, callback ordering/filtering/reentrancy, concurrent registration/removal and disconnect, and keepalive shutdown without requiring a live grid.
hugo closed this issue 2026-08-09 14:47:18 +00:00
Sign in to join this conversation.