Reference

std/network

The network: name resolution, TCP - a listener that accepts connections and a stream whose two directions are a Source and a Sink of Bytes - and UDP, a socket that sends and receives datagrams. The IP addresses and socket addresses it connects to are the values of std/ip, re-exported here, so a file that only names an address can import them without claiming the network.

const server = TcpListener.listen(SocketAddress(IpAddress.loopback, 0))?
const client = TcpStream.connect(server.localAddress()).await()?

Everything that waits answers a Task and is cancellable; a timeout is within. Needs the network capability inside a sandboxed script. See docs/design/NETWORK.md for the IO core under it; TLS is std/tls.

Modules

Everything