|
|
@ -11,6 +11,46 @@ import ( |
|
|
|
"internal/wasi/sockets/v0.2.0/network" |
|
|
|
) |
|
|
|
|
|
|
|
// InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream".
|
|
|
|
//
|
|
|
|
// See [streams.InputStream] for more information.
|
|
|
|
type InputStream = streams.InputStream |
|
|
|
|
|
|
|
// OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream".
|
|
|
|
//
|
|
|
|
// See [streams.OutputStream] for more information.
|
|
|
|
type OutputStream = streams.OutputStream |
|
|
|
|
|
|
|
// Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable".
|
|
|
|
//
|
|
|
|
// See [poll.Pollable] for more information.
|
|
|
|
type Pollable = poll.Pollable |
|
|
|
|
|
|
|
// Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration".
|
|
|
|
//
|
|
|
|
// See [monotonicclock.Duration] for more information.
|
|
|
|
type Duration = monotonicclock.Duration |
|
|
|
|
|
|
|
// Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network".
|
|
|
|
//
|
|
|
|
// See [network.Network] for more information.
|
|
|
|
type Network = network.Network |
|
|
|
|
|
|
|
// ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code".
|
|
|
|
//
|
|
|
|
// See [network.ErrorCode] for more information.
|
|
|
|
type ErrorCode = network.ErrorCode |
|
|
|
|
|
|
|
// IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address".
|
|
|
|
//
|
|
|
|
// See [network.IPSocketAddress] for more information.
|
|
|
|
type IPSocketAddress = network.IPSocketAddress |
|
|
|
|
|
|
|
// IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family".
|
|
|
|
//
|
|
|
|
// See [network.IPAddressFamily] for more information.
|
|
|
|
type IPAddressFamily = network.IPAddressFamily |
|
|
|
|
|
|
|
// ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type".
|
|
|
|
//
|
|
|
|
// enum shutdown-type {
|
|
|
@ -81,10 +121,6 @@ func (self TCPSocket) ResourceDrop() { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [resource-drop]tcp-socket
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketResourceDrop(self0 uint32) |
|
|
|
|
|
|
|
// Accept represents the imported method "accept".
|
|
|
|
//
|
|
|
|
// Accept a new client socket.
|
|
|
@ -120,16 +156,12 @@ func wasmimport_TCPSocketResourceDrop(self0 uint32) |
|
|
|
// accept: func() -> result<tuple<tcp-socket, input-stream, output-stream>, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, streams.InputStream, streams.OutputStream], network.ErrorCode]) { |
|
|
|
func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketAccept((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.accept
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, streams.InputStream, streams.OutputStream], network.ErrorCode]) |
|
|
|
|
|
|
|
// AddressFamily represents the imported method "address-family".
|
|
|
|
//
|
|
|
|
// Whether this is a IPv4 or IPv6 socket.
|
|
|
@ -139,62 +171,46 @@ func wasmimport_TCPSocketAccept(self0 uint32, result *cm.Result[TupleTCPSocketIn |
|
|
|
// address-family: func() -> ip-address-family
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) AddressFamily() (result network.IPAddressFamily) { |
|
|
|
func (self TCPSocket) AddressFamily() (result IPAddressFamily) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
result0 := wasmimport_TCPSocketAddressFamily((uint32)(self0)) |
|
|
|
result = (network.IPAddressFamily)((uint32)(result0)) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.address-family
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketAddressFamily(self0 uint32) (result0 uint32) |
|
|
|
|
|
|
|
// FinishBind represents the imported method "finish-bind".
|
|
|
|
//
|
|
|
|
// finish-bind: func() -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) FinishBind() (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketFinishBind((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-bind
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketFinishBind(self0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// FinishConnect represents the imported method "finish-connect".
|
|
|
|
//
|
|
|
|
// finish-connect: func() -> result<tuple<input-stream, output-stream>, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[streams.InputStream, streams.OutputStream], network.ErrorCode]) { |
|
|
|
func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketFinishConnect((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-connect
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketFinishConnect(self0 uint32, result *cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[streams.InputStream, streams.OutputStream], network.ErrorCode]) |
|
|
|
|
|
|
|
// FinishListen represents the imported method "finish-listen".
|
|
|
|
//
|
|
|
|
// finish-listen: func() -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) FinishListen() (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketFinishListen((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.finish-listen
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// HopLimit represents the imported method "hop-limit".
|
|
|
|
//
|
|
|
|
// Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options.
|
|
|
@ -207,16 +223,12 @@ func wasmimport_TCPSocketFinishListen(self0 uint32, result *cm.Result[network.Er |
|
|
|
// hop-limit: func() -> result<u8, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketHopLimit((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.hop-limit
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketHopLimit(self0 uint32, result *cm.Result[uint8, uint8, network.ErrorCode]) |
|
|
|
|
|
|
|
// IsListening represents the imported method "is-listening".
|
|
|
|
//
|
|
|
|
// Whether the socket is in the `listening` state.
|
|
|
@ -233,10 +245,6 @@ func (self TCPSocket) IsListening() (result bool) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.is-listening
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) |
|
|
|
|
|
|
|
// KeepAliveCount represents the imported method "keep-alive-count".
|
|
|
|
//
|
|
|
|
// The maximum amount of keepalive packets TCP should send before aborting the connection.
|
|
|
@ -255,16 +263,12 @@ func wasmimport_TCPSocketIsListening(self0 uint32) (result0 uint32) |
|
|
|
// keep-alive-count: func() -> result<u32, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketKeepAliveCount((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-count
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, uint32, network.ErrorCode]) |
|
|
|
|
|
|
|
// KeepAliveEnabled represents the imported method "keep-alive-enabled".
|
|
|
|
//
|
|
|
|
// Enables or disables keepalive.
|
|
|
@ -281,16 +285,12 @@ func wasmimport_TCPSocketKeepAliveCount(self0 uint32, result *cm.Result[uint32, |
|
|
|
// keep-alive-enabled: func() -> result<bool, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketKeepAliveEnabled((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-enabled
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, bool, network.ErrorCode]) |
|
|
|
|
|
|
|
// KeepAliveIdleTime represents the imported method "keep-alive-idle-time".
|
|
|
|
//
|
|
|
|
// Amount of time the connection has to be idle before TCP starts sending keepalive
|
|
|
@ -310,16 +310,12 @@ func wasmimport_TCPSocketKeepAliveEnabled(self0 uint32, result *cm.Result[bool, |
|
|
|
// keep-alive-idle-time: func() -> result<duration, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, monotonicclock.Duration, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketKeepAliveIdleTime((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-idle-time
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint64, monotonicclock.Duration, network.ErrorCode]) |
|
|
|
|
|
|
|
// KeepAliveInterval represents the imported method "keep-alive-interval".
|
|
|
|
//
|
|
|
|
// The time between keepalive packets.
|
|
|
@ -338,16 +334,12 @@ func wasmimport_TCPSocketKeepAliveIdleTime(self0 uint32, result *cm.Result[uint6 |
|
|
|
// keep-alive-interval: func() -> result<duration, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, monotonicclock.Duration, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketKeepAliveInterval((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.keep-alive-interval
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint64, monotonicclock.Duration, network.ErrorCode]) |
|
|
|
|
|
|
|
// LocalAddress represents the imported method "local-address".
|
|
|
|
//
|
|
|
|
// Get the bound local address.
|
|
|
@ -371,16 +363,12 @@ func wasmimport_TCPSocketKeepAliveInterval(self0 uint32, result *cm.Result[uint6 |
|
|
|
// local-address: func() -> result<ip-socket-address, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, network.IPSocketAddress, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketLocalAddress((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.local-address
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, network.IPSocketAddress, network.ErrorCode]) |
|
|
|
|
|
|
|
// ReceiveBufferSize represents the imported method "receive-buffer-size".
|
|
|
|
//
|
|
|
|
// The kernel buffer space reserved for sends/receives on this socket.
|
|
|
@ -399,16 +387,12 @@ func wasmimport_TCPSocketLocalAddress(self0 uint32, result *cm.Result[IPSocketAd |
|
|
|
// receive-buffer-size: func() -> result<u64, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketReceiveBufferSize((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.receive-buffer-size
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint64, uint64, network.ErrorCode]) |
|
|
|
|
|
|
|
// RemoteAddress represents the imported method "remote-address".
|
|
|
|
//
|
|
|
|
// Get the remote address.
|
|
|
@ -425,111 +409,83 @@ func wasmimport_TCPSocketReceiveBufferSize(self0 uint32, result *cm.Result[uint6 |
|
|
|
// remote-address: func() -> result<ip-socket-address, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, network.IPSocketAddress, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketRemoteAddress((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.remote-address
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketRemoteAddress(self0 uint32, result *cm.Result[IPSocketAddressShape, network.IPSocketAddress, network.ErrorCode]) |
|
|
|
|
|
|
|
// SendBufferSize represents the imported method "send-buffer-size".
|
|
|
|
//
|
|
|
|
// send-buffer-size: func() -> result<u64, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketSendBufferSize((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.send-buffer-size
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSendBufferSize(self0 uint32, result *cm.Result[uint64, uint64, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetHopLimit represents the imported method "set-hop-limit".
|
|
|
|
//
|
|
|
|
// set-hop-limit: func(value: u8) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint32)(value) |
|
|
|
wasmimport_TCPSocketSetHopLimit((uint32)(self0), (uint32)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-hop-limit
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetHopLimit(self0 uint32, value0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetKeepAliveCount represents the imported method "set-keep-alive-count".
|
|
|
|
//
|
|
|
|
// set-keep-alive-count: func(value: u32) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint32)(value) |
|
|
|
wasmimport_TCPSocketSetKeepAliveCount((uint32)(self0), (uint32)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-count
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetKeepAliveCount(self0 uint32, value0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled".
|
|
|
|
//
|
|
|
|
// set-keep-alive-enabled: func(value: bool) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := cm.BoolToU32(value) |
|
|
|
wasmimport_TCPSocketSetKeepAliveEnabled((uint32)(self0), (uint32)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-enabled
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetKeepAliveEnabled(self0 uint32, value0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time".
|
|
|
|
//
|
|
|
|
// set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetKeepAliveIdleTime(value monotonicclock.Duration) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint64)(value) |
|
|
|
wasmimport_TCPSocketSetKeepAliveIdleTime((uint32)(self0), (uint64)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-idle-time
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetKeepAliveIdleTime(self0 uint32, value0 uint64, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetKeepAliveInterval represents the imported method "set-keep-alive-interval".
|
|
|
|
//
|
|
|
|
// set-keep-alive-interval: func(value: duration) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetKeepAliveInterval(value monotonicclock.Duration) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint64)(value) |
|
|
|
wasmimport_TCPSocketSetKeepAliveInterval((uint32)(self0), (uint64)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-keep-alive-interval
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetListenBacklogSize represents the imported method "set-listen-backlog-size".
|
|
|
|
//
|
|
|
|
// Hints the desired listen queue size. Implementations are free to ignore this.
|
|
|
@ -548,49 +504,37 @@ func wasmimport_TCPSocketSetKeepAliveInterval(self0 uint32, value0 uint64, resul |
|
|
|
// set-listen-backlog-size: func(value: u64) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint64)(value) |
|
|
|
wasmimport_TCPSocketSetListenBacklogSize((uint32)(self0), (uint64)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-listen-backlog-size
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetListenBacklogSize(self0 uint32, value0 uint64, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetReceiveBufferSize represents the imported method "set-receive-buffer-size".
|
|
|
|
//
|
|
|
|
// set-receive-buffer-size: func(value: u64) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint64)(value) |
|
|
|
wasmimport_TCPSocketSetReceiveBufferSize((uint32)(self0), (uint64)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-receive-buffer-size
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetReceiveBufferSize(self0 uint32, value0 uint64, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// SetSendBufferSize represents the imported method "set-send-buffer-size".
|
|
|
|
//
|
|
|
|
// set-send-buffer-size: func(value: u64) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
value0 := (uint64)(value) |
|
|
|
wasmimport_TCPSocketSetSendBufferSize((uint32)(self0), (uint64)(value0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.set-send-buffer-size
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// Shutdown represents the imported method "shutdown".
|
|
|
|
//
|
|
|
|
// Initiate a graceful shutdown.
|
|
|
@ -620,17 +564,13 @@ func wasmimport_TCPSocketSetSendBufferSize(self0 uint32, value0 uint64, result * |
|
|
|
// shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
shutdownType0 := (uint32)(shutdownType) |
|
|
|
wasmimport_TCPSocketShutdown((uint32)(self0), (uint32)(shutdownType0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.shutdown
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// StartBind represents the imported method "start-bind".
|
|
|
|
//
|
|
|
|
// Bind the socket to a specific network on the provided IP address and port.
|
|
|
@ -685,7 +625,7 @@ func wasmimport_TCPSocketShutdown(self0 uint32, shutdownType0 uint32, result *cm |
|
|
|
// result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) StartBind(network_ network.Network, localAddress network.IPSocketAddress) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
network0 := cm.Reinterpret[uint32](network_) |
|
|
|
localAddress0, localAddress1, localAddress2, localAddress3, localAddress4, localAddress5, localAddress6, localAddress7, localAddress8, localAddress9, localAddress10, localAddress11 := lower_IPSocketAddress(localAddress) |
|
|
@ -693,10 +633,6 @@ func (self TCPSocket) StartBind(network_ network.Network, localAddress network.I |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-bind
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 uint32, localAddress1 uint32, localAddress2 uint32, localAddress3 uint32, localAddress4 uint32, localAddress5 uint32, localAddress6 uint32, localAddress7 uint32, localAddress8 uint32, localAddress9 uint32, localAddress10 uint32, localAddress11 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// StartConnect represents the imported method "start-connect".
|
|
|
|
//
|
|
|
|
// Connect to a remote endpoint.
|
|
|
@ -757,7 +693,7 @@ func wasmimport_TCPSocketStartBind(self0 uint32, network0 uint32, localAddress0 |
|
|
|
// -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) StartConnect(network_ network.Network, remoteAddress network.IPSocketAddress) (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
network0 := cm.Reinterpret[uint32](network_) |
|
|
|
remoteAddress0, remoteAddress1, remoteAddress2, remoteAddress3, remoteAddress4, remoteAddress5, remoteAddress6, remoteAddress7, remoteAddress8, remoteAddress9, remoteAddress10, remoteAddress11 := lower_IPSocketAddress(remoteAddress) |
|
|
@ -765,10 +701,6 @@ func (self TCPSocket) StartConnect(network_ network.Network, remoteAddress netwo |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-connect
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddress0 uint32, remoteAddress1 uint32, remoteAddress2 uint32, remoteAddress3 uint32, remoteAddress4 uint32, remoteAddress5 uint32, remoteAddress6 uint32, remoteAddress7 uint32, remoteAddress8 uint32, remoteAddress9 uint32, remoteAddress10 uint32, remoteAddress11 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// StartListen represents the imported method "start-listen".
|
|
|
|
//
|
|
|
|
// Start listening for new connections.
|
|
|
@ -803,16 +735,12 @@ func wasmimport_TCPSocketStartConnect(self0 uint32, network0 uint32, remoteAddre |
|
|
|
// start-listen: func() -> result<_, error-code>
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) StartListen() (result cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) { |
|
|
|
func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode]) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
wasmimport_TCPSocketStartListen((uint32)(self0), &result) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.start-listen
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[network.ErrorCode, struct{}, network.ErrorCode]) |
|
|
|
|
|
|
|
// Subscribe represents the imported method "subscribe".
|
|
|
|
//
|
|
|
|
// Create a `pollable` which can be used to poll for, or block on,
|
|
|
@ -836,13 +764,9 @@ func wasmimport_TCPSocketStartListen(self0 uint32, result *cm.Result[network.Err |
|
|
|
// subscribe: func() -> pollable
|
|
|
|
//
|
|
|
|
//go:nosplit
|
|
|
|
func (self TCPSocket) Subscribe() (result poll.Pollable) { |
|
|
|
func (self TCPSocket) Subscribe() (result Pollable) { |
|
|
|
self0 := cm.Reinterpret[uint32](self) |
|
|
|
result0 := wasmimport_TCPSocketSubscribe((uint32)(self0)) |
|
|
|
result = cm.Reinterpret[poll.Pollable]((uint32)(result0)) |
|
|
|
result = cm.Reinterpret[Pollable]((uint32)(result0)) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
//go:wasmimport wasi:sockets/tcp@0.2.0 [method]tcp-socket.subscribe
|
|
|
|
//go:noescape
|
|
|
|
func wasmimport_TCPSocketSubscribe(self0 uint32) (result0 uint32) |
|
|
|