Expand description
Socket quota tracking and WASI socket host implementations.
This module provides SocketPermitState, SpinSocketsView, and
SpinSockets — the types needed to intercept WASI TCP/UDP socket
creation and enforce a per-app cap on the number of concurrently open
sockets.
Structs§
- Socket
Permit State - Shared state for tracking per-socket semaphore permits. Permits are
acquired when a socket is allocated (at
start_connectfor TCP, atcreate_udp_socketfor UDP) and released when the socket resource is dropped. - Spin
Sockets HasDataaccessor forSpinSocketsView, used in place of [WasiSockets] when registering TCP socket bindings so thatstart_connectanddropcan participate in socket quota tracking.- Spin
Sockets View - A view over WASI socket state that carries an optional per-instance socket permit store, enabling per-connection quota tracking.