Documentation
¶
Overview ¶
Package tcp represents the imported interface "wasi:sockets/tcp@0.2.0".
Index ¶
- type Duration
- type ErrorCode
- type IPAddressFamily
- type IPSocketAddress
- type IPSocketAddressShape
- type InputStream
- type Network
- type OutputStream
- type Pollable
- type ShutdownType
- type TCPSocket
- func (self TCPSocket) Accept() (...)
- func (self TCPSocket) AddressFamily() (result IPAddressFamily)
- func (self TCPSocket) FinishBind() (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) FinishConnect() (...)
- func (self TCPSocket) FinishListen() (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) HopLimit() (result cm.Result[uint8, uint8, ErrorCode])
- func (self TCPSocket) IsListening() (result bool)
- func (self TCPSocket) KeepAliveCount() (result cm.Result[uint32, uint32, ErrorCode])
- func (self TCPSocket) KeepAliveEnabled() (result cm.Result[bool, bool, ErrorCode])
- func (self TCPSocket) KeepAliveIdleTime() (result cm.Result[uint64, Duration, ErrorCode])
- func (self TCPSocket) KeepAliveInterval() (result cm.Result[uint64, Duration, ErrorCode])
- func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode])
- func (self TCPSocket) ReceiveBufferSize() (result cm.Result[uint64, uint64, ErrorCode])
- func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode])
- func (self TCPSocket) ResourceDrop()
- func (self TCPSocket) SendBufferSize() (result cm.Result[uint64, uint64, ErrorCode])
- func (self TCPSocket) SetHopLimit(value uint8) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) StartListen() (result cm.Result[ErrorCode, struct{}, ErrorCode])
- func (self TCPSocket) Subscribe() (result Pollable)
- type TupleInputStreamOutputStreamShape
- type TupleTCPSocketInputStreamOutputStreamShape
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Duration ¶ added in v0.0.4
type Duration = monotonicclock.Duration
Duration represents the type alias "wasi:sockets/tcp@0.2.0#duration".
See monotonicclock.Duration for more information.
type ErrorCode ¶ added in v0.0.4
ErrorCode represents the type alias "wasi:sockets/tcp@0.2.0#error-code".
See network.ErrorCode for more information.
type IPAddressFamily ¶ added in v0.0.4
type IPAddressFamily = network.IPAddressFamily
IPAddressFamily represents the type alias "wasi:sockets/tcp@0.2.0#ip-address-family".
See network.IPAddressFamily for more information.
type IPSocketAddress ¶ added in v0.0.4
type IPSocketAddress = network.IPSocketAddress
IPSocketAddress represents the type alias "wasi:sockets/tcp@0.2.0#ip-socket-address".
See network.IPSocketAddress for more information.
type IPSocketAddressShape ¶
type IPSocketAddressShape struct {
// contains filtered or unexported fields
}
IPSocketAddressShape is used for storage in variant or result types.
type InputStream ¶ added in v0.0.4
type InputStream = streams.InputStream
InputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#input-stream".
See streams.InputStream for more information.
type Network ¶ added in v0.0.4
Network represents the imported type alias "wasi:sockets/tcp@0.2.0#network".
See network.Network for more information.
type OutputStream ¶ added in v0.0.4
type OutputStream = streams.OutputStream
OutputStream represents the imported type alias "wasi:sockets/tcp@0.2.0#output-stream".
See streams.OutputStream for more information.
type Pollable ¶ added in v0.0.4
Pollable represents the imported type alias "wasi:sockets/tcp@0.2.0#pollable".
See poll.Pollable for more information.
type ShutdownType ¶
type ShutdownType uint8
ShutdownType represents the enum "wasi:sockets/tcp@0.2.0#shutdown-type".
enum shutdown-type { receive, send, both }
const ( ShutdownTypeReceive ShutdownType = iota ShutdownTypeSend ShutdownTypeBoth )
func (ShutdownType) String ¶
func (e ShutdownType) String() string
String implements fmt.Stringer, returning the enum case name of e.
type TCPSocket ¶
TCPSocket represents the imported resource "wasi:sockets/tcp@0.2.0#tcp-socket".
resource tcp-socket
func (TCPSocket) Accept ¶
func (self TCPSocket) Accept() (result cm.Result[TupleTCPSocketInputStreamOutputStreamShape, cm.Tuple3[TCPSocket, InputStream, OutputStream], ErrorCode])
Accept represents the imported method "accept".
accept: func() -> result<tuple<tcp-socket, input-stream, output-stream>, error-code>
func (TCPSocket) AddressFamily ¶
func (self TCPSocket) AddressFamily() (result IPAddressFamily)
AddressFamily represents the imported method "address-family".
address-family: func() -> ip-address-family
func (TCPSocket) FinishBind ¶
FinishBind represents the imported method "finish-bind".
finish-bind: func() -> result<_, error-code>
func (TCPSocket) FinishConnect ¶
func (self TCPSocket) FinishConnect() (result cm.Result[TupleInputStreamOutputStreamShape, cm.Tuple[InputStream, OutputStream], ErrorCode])
FinishConnect represents the imported method "finish-connect".
finish-connect: func() -> result<tuple<input-stream, output-stream>, error-code>
func (TCPSocket) FinishListen ¶
FinishListen represents the imported method "finish-listen".
finish-listen: func() -> result<_, error-code>
func (TCPSocket) HopLimit ¶
HopLimit represents the imported method "hop-limit".
hop-limit: func() -> result<u8, error-code>
func (TCPSocket) IsListening ¶
IsListening represents the imported method "is-listening".
is-listening: func() -> bool
func (TCPSocket) KeepAliveCount ¶
KeepAliveCount represents the imported method "keep-alive-count".
keep-alive-count: func() -> result<u32, error-code>
func (TCPSocket) KeepAliveEnabled ¶
KeepAliveEnabled represents the imported method "keep-alive-enabled".
keep-alive-enabled: func() -> result<bool, error-code>
func (TCPSocket) KeepAliveIdleTime ¶
KeepAliveIdleTime represents the imported method "keep-alive-idle-time".
keep-alive-idle-time: func() -> result<duration, error-code>
func (TCPSocket) KeepAliveInterval ¶
KeepAliveInterval represents the imported method "keep-alive-interval".
keep-alive-interval: func() -> result<duration, error-code>
func (TCPSocket) LocalAddress ¶
func (self TCPSocket) LocalAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode])
LocalAddress represents the imported method "local-address".
local-address: func() -> result<ip-socket-address, error-code>
func (TCPSocket) ReceiveBufferSize ¶
ReceiveBufferSize represents the imported method "receive-buffer-size".
receive-buffer-size: func() -> result<u64, error-code>
func (TCPSocket) RemoteAddress ¶
func (self TCPSocket) RemoteAddress() (result cm.Result[IPSocketAddressShape, IPSocketAddress, ErrorCode])
RemoteAddress represents the imported method "remote-address".
remote-address: func() -> result<ip-socket-address, error-code>
func (TCPSocket) ResourceDrop ¶
func (self TCPSocket) ResourceDrop()
ResourceDrop represents the imported resource-drop for resource "tcp-socket".
Drops a resource handle.
func (TCPSocket) SendBufferSize ¶
SendBufferSize represents the imported method "send-buffer-size".
send-buffer-size: func() -> result<u64, error-code>
func (TCPSocket) SetHopLimit ¶
SetHopLimit represents the imported method "set-hop-limit".
set-hop-limit: func(value: u8) -> result<_, error-code>
func (TCPSocket) SetKeepAliveCount ¶
func (self TCPSocket) SetKeepAliveCount(value uint32) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetKeepAliveCount represents the imported method "set-keep-alive-count".
set-keep-alive-count: func(value: u32) -> result<_, error-code>
func (TCPSocket) SetKeepAliveEnabled ¶
func (self TCPSocket) SetKeepAliveEnabled(value bool) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetKeepAliveEnabled represents the imported method "set-keep-alive-enabled".
set-keep-alive-enabled: func(value: bool) -> result<_, error-code>
func (TCPSocket) SetKeepAliveIdleTime ¶
func (self TCPSocket) SetKeepAliveIdleTime(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetKeepAliveIdleTime represents the imported method "set-keep-alive-idle-time".
set-keep-alive-idle-time: func(value: duration) -> result<_, error-code>
func (TCPSocket) SetKeepAliveInterval ¶
func (self TCPSocket) SetKeepAliveInterval(value Duration) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetKeepAliveInterval represents the imported method "set-keep-alive-interval".
set-keep-alive-interval: func(value: duration) -> result<_, error-code>
func (TCPSocket) SetListenBacklogSize ¶
func (self TCPSocket) SetListenBacklogSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetListenBacklogSize represents the imported method "set-listen-backlog-size".
set-listen-backlog-size: func(value: u64) -> result<_, error-code>
func (TCPSocket) SetReceiveBufferSize ¶
func (self TCPSocket) SetReceiveBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetReceiveBufferSize represents the imported method "set-receive-buffer-size".
set-receive-buffer-size: func(value: u64) -> result<_, error-code>
func (TCPSocket) SetSendBufferSize ¶
func (self TCPSocket) SetSendBufferSize(value uint64) (result cm.Result[ErrorCode, struct{}, ErrorCode])
SetSendBufferSize represents the imported method "set-send-buffer-size".
set-send-buffer-size: func(value: u64) -> result<_, error-code>
func (TCPSocket) Shutdown ¶
func (self TCPSocket) Shutdown(shutdownType ShutdownType) (result cm.Result[ErrorCode, struct{}, ErrorCode])
Shutdown represents the imported method "shutdown".
shutdown: func(shutdown-type: shutdown-type) -> result<_, error-code>
func (TCPSocket) StartBind ¶
func (self TCPSocket) StartBind(network_ Network, localAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode])
StartBind represents the imported method "start-bind".
start-bind: func(network: borrow<network>, local-address: ip-socket-address) -> result<_, error-code>
func (TCPSocket) StartConnect ¶
func (self TCPSocket) StartConnect(network_ Network, remoteAddress IPSocketAddress) (result cm.Result[ErrorCode, struct{}, ErrorCode])
StartConnect represents the imported method "start-connect".
start-connect: func(network: borrow<network>, remote-address: ip-socket-address) -> result<_, error-code>
func (TCPSocket) StartListen ¶
StartListen represents the imported method "start-listen".
start-listen: func() -> result<_, error-code>
type TupleInputStreamOutputStreamShape ¶
type TupleInputStreamOutputStreamShape struct {
// contains filtered or unexported fields
}
TupleInputStreamOutputStreamShape is used for storage in variant or result types.
type TupleTCPSocketInputStreamOutputStreamShape ¶
type TupleTCPSocketInputStreamOutputStreamShape struct {
// contains filtered or unexported fields
}
TupleTCPSocketInputStreamOutputStreamShape is used for storage in variant or result types.