nx_udp_loopback.nx
buildroot/runtime/nx_udp_loopback.nx
about
nx_udp_loopback.nx -- proves SOVEREIGN UDP sockets on the nx_syscalls (rv64->x86_64) layer,
the foundation the tracker announce round-trip (X-TORRENT-LIVE-001 R2b) needs. The existing UDP
organs ride OTHER syscall layers (nx_udp.nx -> nx_syscalls_x86_64, net.nx -> syscalls.nx); the
tracker build/parse (nx_udp_tracker) is on nx_syscalls.nx, so this proves the round-trip plumbing
on THAT layer to avoid a mixed-layer conflict. Pattern (the proven H2 fork-server+client loopback):
bind the server socket BEFORE fork (eliminates the bind/send race) + SO_RCV/SNDTIMEO (no-hang law:
every recvfrom is bounded). Child = echo server (inherits the bound fd); parent = client; assert
the echo round-trips byte-exact over 127.0.0.1. Self-gating. license_tier: ORIGINAL
module: nishi-core.torrent.udp_loopback
depends: nishi-core.sys.syscalls
capability: SOVEREIGN_UDP_ROUNDTRIP
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const K_MAGIC_53117: i64 = 53117 |
functions
| 17 | func ul_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 22 | func ul_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 } |
| 25 | func ul_sockaddr(sa: *u8, port: i64, i0: i64, i1: i64, i2: i64, i3: i64) -> i64 called by 1: main |
| 34 | func main() -> i64 |