pub enum StreamSocketRequest {
Close {
responder: StreamSocketCloseResponder,
},
Bind {
addr: VsockAddress,
responder: StreamSocketBindResponder,
},
Connect {
remote_address: VsockAddress,
responder: StreamSocketConnectResponder,
},
Listen {
backlog: i32,
responder: StreamSocketListenResponder,
},
Accept {
want_addr: bool,
responder: StreamSocketAcceptResponder,
},
GetSockName {
responder: StreamSocketGetSockNameResponder,
},
GetPeerName {
responder: StreamSocketGetPeerNameResponder,
},
GetError {
responder: StreamSocketGetErrorResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: StreamSocketControlHandle,
method_type: MethodType,
},
}Expand description
StreamSocket represents the control plane for a single virtio-socket stream socket.
Variants§
Close
Terminates the connection.
After calling Close, the client must not send any other requests.
Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.
Closing the client end of the channel should be semantically equivalent
to calling Close without knowing when the close has completed or its
status.
Fields
responder: StreamSocketCloseResponderBind
Bind this socket to a specific address.
Connect
Initiate a connection to |remote_address|. When the connection attempt completes the signal SIGNAL_STREAM_CONNECTED will be asserted on the data plane zx.Handle:SOCKET.
Listen
Places this socket into listening mode with a specified backlog. When a new connection is available the signal SIGNAL_STREAM_INCOMING will be asserted on the data plane zx.Handle:SOCKET.
Accept
Accepts a connection from this socket’s listen backlog and binds it to |socket| with data plane |data|. If |want_addr| is true, returns the address of the accepted socket. When this call returns, if SIGNAL_STREAM_INCOMING is asserted another incoming connection is available.
GetSockName
Retrieves the local socket address.
Fields
responder: StreamSocketGetSockNameResponderGetPeerName
Retrieves the remote socket address.
Fields
responder: StreamSocketGetPeerNameResponderGetError
Get SOL_SOCKET -> SO_ERROR
Fields
responder: StreamSocketGetErrorResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: StreamSocketControlHandlemethod_type: MethodTypeImplementations§
Source§impl StreamSocketRequest
impl StreamSocketRequest
pub fn into_close(self) -> Option<StreamSocketCloseResponder>
pub fn into_bind(self) -> Option<(VsockAddress, StreamSocketBindResponder)>
pub fn into_connect( self, ) -> Option<(VsockAddress, StreamSocketConnectResponder)>
pub fn into_listen(self) -> Option<(i32, StreamSocketListenResponder)>
pub fn into_accept(self) -> Option<(bool, StreamSocketAcceptResponder)>
pub fn into_get_sock_name(self) -> Option<StreamSocketGetSockNameResponder>
pub fn into_get_peer_name(self) -> Option<StreamSocketGetPeerNameResponder>
pub fn into_get_error(self) -> Option<StreamSocketGetErrorResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL