code wiki / (root) / nx_netprobe_lib.nx

nx_netprobe_lib.nx

buildroot/runtime/nx_netprobe_lib.nx

2528 B46 linesdepth 2pulls 2 transitivereach 11 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_netprobe_lib.nx -- THE one act a caller performs to ask "is this TCP endpoint reachable?": a bounded non-blocking connect + poll(POLLOUT) + getsockopt(SO_ERROR). Library only (NO main), so any organ imports it without a duplicate entry point. WHY (DRY consolidation, 2026-08-12): this exact probe existed TWICE -- go_worker_up inside the live nx_gen_worker daemon (the multi-worker liveness selector) and go_probe_up inside nx_swarm_heal. nx_gen_worker has a main() so it could not be imported, which is how the copy was born. Extracting the ONE act both perform is the fix (rule 15); both now call np_probe_up. STRONGEST-EVIDENCE contract: reachable ONLY when getsockopt SO_ERROR == 0 (not merely poll-writable), so a refused/half-open connection reads DOWN. Fail-safe: any socket/syscall failure -> 0 (down). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_netprobe_lib.nx nx_gen_worker.nx nx_netprobe_ladder.nx nx_swarm_heal.nx

imports: nx_syscalls.nx

imported by: nx_gen_worker.nxnx_netprobe_ladder.nxnx_swarm_heal.nx

structs

none

consts

none

functions

16func np_probe_up_to(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, timeout_ms: i64) -> i64
44func np_probe_up(ha: i64, hb: i64, hc: i64, hd: i64, port: i64) -> i64