Net
module Net
Shared networking values, capability discovery, and typed failures.
using Net
let https = Port.from(443).try
if Support.current.tls.usable? then https.string else "TLS unavailable" end
record Port
A validated TCP or UDP port number in 0..65535.
Use Port.from at input boundaries. Port zero requests an ephemeral port where a listening API permits it.
Fields
valueInteger
Methods
record SupportValue
Whether a feature was compiled into this backend and is usable now.
Fields
record SupportReport
Granular networking capabilities for the current backend and environment.
Fields
dnsSupportValuetcpSupportValueudpSupportValueunixSupportValuetlsSupportValuehttpClientSupportValuehttpServerSupportValuewebSocketClientSupportValuewebSocketServerSupportValue
module Net.Port
module Net.Support
current constant
current : SupportReport
Reports compiled and currently usable networking features.
Examples
+Support.current.httpClient.usable?+.
type NetOperation
The subsystem or operation that produced a networking error.
Variants
DNSTCPUDPUnixTLSHTTPClientHTTPServerWebSocketClientWebSocketServer
type NetErrorKind
Stable, backend-independent networking failure categories.
Variants
ParseResolveConnectProtocolTimeoutCancelledLimitClosedReadInProgressUnsupportedBackendUnsupportedOptionBrowserRestrictedOpaqueRedirectMockEmptyBackend
record NetError
A typed networking failure. phase adds optional protocol context and progress records bytes transferred before a partial-operation failure.
Fields
kindNetErrorKindoperationNetOperationmessageStringphaseString?progressInteger?
Submodules
Net.DNSTyped DNS lookup with explicit resolver ownership and bounded caching.Net.HTTPBuffered HTTP clients, responses, and a small declaration-ordered server router. Requests never follow redirects or perform generic retries implicitly.Net.HTTP.WebSocketHigh-level RFC 6455 client messages. The runtime handles fragmentation and ping/pong frames; reconnect and heartbeat policies remain application-owned.Net.IPValidated, canonical IP addresses and CIDR networks.Net.SocketProcess-owned TCP byte streams and listeners. All blocking operations return typedNetErrorvalues; close operations are idempotent.