feat(relay): notify peers when room members leave
The relay now sends a reliable PeerLeft control event to remaining room peers after removing the departed peer from session and room state. Normal connection closure is reported as Normal, while malformed-datagram disconnects are reported as ProtocolError. This completes the first relay-side lifecycle event pair. Delivery remains best-effort and client-side event consumption is intentionally left for a separate slice. Test Plan: - cargo fmt --check - cargo test -p lanparty-relay forwards_ethernet_datagrams_between_joined_peers \ -- --nocapture - cargo test -p lanparty-relay - cargo clippy -p lanparty-relay --all-targets -- -D warnings - cargo test --workspace - cargo clippy --workspace --all-targets -- -D warnings - git diff --check Refs: PLAN.md
This commit is contained in:
@@ -84,7 +84,7 @@ Public relay binary and relay-owned room state:
|
||||
- one gateway per room, duplicate client MAC rejection, and room limits
|
||||
- stable effective room MTU chosen before Ethernet datagrams flow
|
||||
- live Ethernet datagram forwarding with no ingress reflection
|
||||
- reliable `PeerJoined` notifications to existing room peers
|
||||
- reliable `PeerJoined`/`PeerLeft` notifications to existing room peers
|
||||
- L2 safety filters for jumbo, switch-control, DHCP-server, and IPv6-RA frames
|
||||
- client broadcast/multicast, unknown-unicast, and total bandwidth limiting
|
||||
- malformed peer datagram disconnect threshold
|
||||
@@ -112,8 +112,8 @@ certificate handling remains future work. Ethernet forwarding decisions are
|
||||
logged with room, peer, MAC, ethertype, action, drop reason, and target count.
|
||||
Unknown unicast from a client is forwarded only to the gateway port; unknown
|
||||
unicast from the gateway is dropped instead of flooded to every remote client.
|
||||
When a peer joins, the relay sends a reliable `PeerJoined` control event to
|
||||
peers that were already present in the room.
|
||||
When a peer joins or leaves, the relay sends a reliable lifecycle control event
|
||||
to peers that are still present in the room.
|
||||
|
||||
## Gateway
|
||||
|
||||
|
||||
Reference in New Issue
Block a user