sockets
Version:
sha256:6864058
network interface
network:resource {
}
error-code:enum {
unknown
access-denied
not-supported
invalid-argument
out-of-memory
timeout
concurrency-conflict
not-in-progress
would-block
invalid-state
new-socket-limit
address-not-bindable
address-in-use
remote-unreachable
connection-refused
connection-reset
connection-aborted
datagram-too-large
name-unresolvable
temporary-resolver-failure
permanent-resolver-failure
}ip-address-family:enum {
ipv4
ipv6
}ipv4-address:tuple {
u8
u8
u8
u8
}ipv6-address:tuple {
u16
u16
u16
u16
u16
u16
u16
u16
}ip-name-lookup interface
Imported Types
wasi:io/poll.{pollable}
wasi:sockets/network.{network}
wasi:sockets/network.{error-code}
wasi:sockets/network.{ip-address}
resolve-address-stream:resource {}
resolve-addresses(network:borrow<network>, name:string) → result<resolve-address-stream, error-code>
tcp interface
Imported Types
wasi:io/streams.{input-stream}
wasi:io/streams.{output-stream}
wasi:io/poll.{pollable}
wasi:clocks/monotonic-clock.{duration}
wasi:sockets/network.{network}
wasi:sockets/network.{error-code}
wasi:sockets/network.{ip-socket-address}
wasi:sockets/network.{ip-address-family}
shutdown-type:enum {
receive
send
both
}tcp-socket:resource {
finish-bind() → result<_, error-code>
finish-connect() → result<tuple<input-stream, output-stream>, error-code>
finish-listen() → result<_, error-code>
is-listening() → bool
set-keep-alive-enabled(value:bool) → result<_, error-code>
set-keep-alive-idle-time(value:duration) → result<_, error-code>
set-keep-alive-interval(value:duration) → result<_, error-code>
set-keep-alive-count(value:u32) → result<_, error-code>
set-hop-limit(value:u8) → result<_, error-code>
set-receive-buffer-size(value:u64) → result<_, error-code>
send-buffer-size() → result<u64, error-code>
set-send-buffer-size(value:u64) → result<_, error-code>
}tcp-create-socket interface
Imported Types
wasi:sockets/network.{network}
wasi:sockets/network.{error-code}
wasi:sockets/network.{ip-address-family}
wasi:sockets/tcp.{tcp-socket}
udp interface
Imported Types
wasi:io/poll.{pollable}
wasi:sockets/network.{network}
wasi:sockets/network.{error-code}
wasi:sockets/network.{ip-socket-address}
wasi:sockets/network.{ip-address-family}
udp-socket:resource {
finish-bind() → result<_, error-code>
stream(remote-address:option<ip-socket-address>) → result<tuple<incoming-datagram-stream, outgoing-datagram-stream>, error-code>
set-unicast-hop-limit(value:u8) → result<_, error-code>
set-receive-buffer-size(value:u64) → result<_, error-code>
send-buffer-size() → result<u64, error-code>
set-send-buffer-size(value:u64) → result<_, error-code>
}incoming-datagram-stream:resource {}
outgoing-datagram-stream:resource {}
udp-create-socket interface
Imported Types
wasi:sockets/network.{network}
wasi:sockets/network.{error-code}
wasi:sockets/network.{ip-address-family}
wasi:sockets/udp.{udp-socket}