code wiki / _hdl_build / nx_room_relay.nx
nx_room_relay.nx
buildroot/runtime/_hdl_build/nx_room_relay.nx
about
nx_room_relay.nx -- the SOVEREIGN server-side relay core for Nishi video.
Per-room, per-peer latest-frame store + live roster. The no-WS down-channel
(nx_room_stream) pushes each peer the OTHER live peers' newest frames; peers
upload via POST. Server-relay model = works through any NAT with ZERO
WebRTC/STUN/TURN (the flaky third-party ICE the cardboard depended on).
Pure buffer ops: imports nothing, no syscalls -- caller supplies the state
arena (like nx_video_client_wasm / nx_room_stream). Proven by nx_room_relay_gate.
State layout (st: *i64): st[0]=nslots, st[1]=slot_bytes, then 5 parallel
arrays of nslots each -> room_hash, peer_id, last_seq, last_seen_ms, frame_len.
A slot is FREE when room_hash==0 (room hashes are nonzero by construction).
Frame bytes for slot i live at arena[i*slot_bytes ..] (arena: nslots*slot_bytes).
license_tier: ORIGINAL
dependencies 0 imports · 10 importers
imports: none
imported by: nx_connect_lds_room.nxnx_game_room_gate.nxnx_mp_relay.nxnx_pets_mp_relay_gate.nxnx_room_fec_relay.nxnx_room_privacy_gate.nxnx_room_relay_gate.nxnx_vroom.nxnx_vroom_daemon.nxnx_vroom_gate.nx
structs
| none |
consts
| none |
functions
| 15 | func rr_init(st: *i64, nslots: i64, slotb: i64) -> i64 |
| 23 | func rr_find(st: *i64, rm: i64, pr: i64) -> i64 |
| 30 | func rr_alloc(st: *i64) -> i64 called by 1: rr_post |
| 37 | func rr_post(st: *i64, arena: *u8, rm: i64, pr: i64, now: i64, sq: i64, frame: *u8, fl: i64) -> i64 |
| 50 | func rr_roster(st: *i64, rm: i64, self_pr: i64, now: i64, ttl: i64, out: *i64) -> i64 |
| 64 | func rr_live(st: *i64, rm: i64, pr: i64, now: i64, ttl: i64) -> i64 |
| 72 | func rr_seq(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 2 * n + s] } |
| 73 | func rr_flen(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 4 * n + s] } |
| 75 | func rr_nslots(st: *i64) -> i64 { return st[0] } |
| 76 | func rr_room(st: *i64, s: i64) -> i64 { return st[2 + s] } |
| 77 | func rr_peer(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + n + s] } |
| 78 | func rr_seen(st: *i64, s: i64) -> i64 { let n: i64 = st[0]; return st[2 + 3 * n + s] } |