code wiki / (root) / nx_okserver.nx

nx_okserver.nx

buildroot/runtime/nx_okserver.nx

1997 B39 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_okserver.nx -- minimal sovereign HTTP service: binds the port given as argv[1] (default 8081) and answers every request "HTTP/1.1 200 OK ... OK". A second real service so nx_runsv_all supervises a genuine multi-service stack. Mirrors nx_archive_server's proven socket setup (SO_REUSEADDR, sockaddr_in, accept loop). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_gate.nx nx_okserver.nx

imports: nx_syscalls.nxnx_gate.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main oks_atoi sys_socket gw sys_write sys_mmap sys_bind gn sys_write ↻ sys_mmap ↻ sys_listen oks_strlen sys_accept sys_read sys_write ↻ sys_close

structs

none

consts

6const K_MAGIC_8081: i64 = 8081
7const K_MAGIC_8192: i64 = 8192

functions

9func oks_atoi(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let d: i64=s[i] as i64; if d>=48 { if d<=57 { v=v*10+(d-48) } } i=i+1 } return v }
called by 1: main
10func oks_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
12func main(argc: i64, argv: *i64) -> i64