Type
tcp-socket
A TCP socket resource.
The socket can be in one of the following states:
unboundbind-in-progressbound(See note below)listen-in-progresslisteningconnect-in-progressconnectedclosedSee https://github.com/WebAssembly/wasi-sockets/blob/main/TcpSocketOperationalSemantics.md for more information.
Note: Except where explicitly mentioned, whenever this documentation uses
the term "bound" without backticks it actually means: in the bound state or higher.
(i.e. bound, listen-in-progress, listening, connect-in-progress or connected)
In addition to the general error codes documented on the
network::error-code type, TCP socket methods may always return
error(invalid-state) when in the closed state.
type tcp-socket = tcp-socket;