nx_netprobe_lib.nx
buildroot/runtime/nx_netprobe_lib.nx
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
imports: nx_syscalls.nx
imported by: nx_gen_worker.nxnx_netprobe_ladder.nxnx_swarm_heal.nx
structs
| none |
consts
| none |
functions
| 16 | func np_probe_up_to(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, timeout_ms: i64) -> i64 |
| 44 | func np_probe_up(ha: i64, hb: i64, hc: i64, hd: i64, port: i64) -> i64 |