This library is in flux. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.
Net
~import std/netKoru Standard Library — Network Operations
net.kz · 5 tors
Koru Standard Library — Network Operations · 24 more lines
Koru Standard Library — Network Operations
THIS SURFACE IS NOT IMPLEMENTED. Every tor below refuses at compile time and
names what to reach for instead.
It previously shipped stub bodies that reported SUCCESS: `tcp.listen` printed
"[NET] Server would listen on port {}" and returned `listening`; `tcp.accept`
returned a hardcoded connection id of 1; `tcp.read` returned a fixed string,
`"GET / HTTP/1.1\r\nHost: localhost\r\n\r\n"`, on every call. A program built
on those compiled, ran, printed plausible logs, and served the same fabricated
request forever — the substitute-output shape the project bans outright.
The declarations stay so the refusal can carry an address. Importing this
module is fine; reaching for a tor is what fails.
WHERE THE REAL SURFACES ARE:
HTTP client — `koru/curl` in koru-libs: a libcurl lift behind phantom
obligations (`*Response<open!>`), with sync and multi-transfer
paths. This is the one to use today.
HTTP server — Orisha, its own repo: a compile-time HTTP server framework.
`orisha:handler` + `orisha:serve(port:)`.
Raw frames — `unikraft/net` in koru-libs lifts uknetdev, but its surface is
Ethernet frames, not sockets. There is no TCP/IP stack in
this project.
tcp.listen
koru_std/net.kz:26// Koru Standard Library — Network Operations
//
// THIS SURFACE IS NOT IMPLEMENTED. Every tor below refuses at compile time and
// names what to reach for instead.
//
// It previously shipped stub bodies that reported SUCCESS: `tcp.listen` printed
// "[NET] Server would listen on port {}" and returned `listening`; `tcp.accept`
// returned a hardcoded connection id of 1; `tcp.read` returned a fixed string,
// `"GET / HTTP/1.1\r\nHost: localhost\r\n\r\n"`, on every call. A program built
// on those compiled, ran, printed plausible logs, and served the same fabricated
// request forever — the substitute-output shape the project bans outright.
//
// The declarations stay so the refusal can carry an address. Importing this
// module is fine; reaching for a tor is what fails.
//
// WHERE THE REAL SURFACES ARE:
// HTTP client — `koru/curl` in koru-libs: a libcurl lift behind phantom
// obligations (`*Response<open!>`), with sync and multi-transfer
// paths. This is the one to use today.
// HTTP server — Orisha, its own repo: a compile-time HTTP server framework.
// `orisha:handler` + `orisha:serve(port:)`.
// Raw frames — `unikraft/net` in koru-libs lifts uknetdev, but its surface is
// Ethernet frames, not sockets. There is no TCP/IP stack in
// this project.
~pub tor tcp.listen { port: u16 }
| listening u16
| error stringtcp.accept
koru_std/net.kz:34~pub tor tcp.accept { port: u16 }
| connection u32
| error stringtcp.read
koru_std/net.kz:42~pub tor tcp.read { id: u32, max_bytes: usize }
| data string
| closed
| error stringtcp.write
koru_std/net.kz:51~pub tor tcp.write { id: u32, data: string }
| sent usize
| error stringtcp.close
koru_std/net.kz:59~pub tor tcp.close { id: u32 }