trait EvalContextPrivExt<'tcx>: MiriInterpCxExt<'tcx> {
// Provided methods
fn block_for_accept(
&mut self,
socket: FileDescriptionRef<Socket>,
address_ptr: Pointer,
address_len_ptr: Pointer,
is_client_sock_nonblock: bool,
dest: MPlaceTy<'tcx>,
) -> InterpResult<'tcx> { ... }
fn try_non_block_accept(
&mut self,
socket: &FileDescriptionRef<Socket>,
address_ptr: Pointer,
address_len_ptr: Pointer,
is_client_sock_nonblock: bool,
) -> InterpResult<'tcx, Result<i32, IoError>> { ... }
fn block_for_send(
&mut self,
socket: FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
) -> InterpResult<'tcx> { ... }
fn try_non_block_send(
&mut self,
socket: &FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
) -> InterpResult<'tcx, Result<usize, IoError>> { ... }
fn block_for_recv(
&mut self,
socket: FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
should_peek: bool,
finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
) -> InterpResult<'tcx> { ... }
fn try_non_block_recv(
&mut self,
socket: &FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
should_peek: bool,
) -> InterpResult<'tcx, Result<usize, IoError>> { ... }
fn ensure_connected(
&mut self,
socket: FileDescriptionRef<Socket>,
should_wait: bool,
foreign_name: &'static str,
action: DynMachineCallback<'tcx, Result<(), ()>>,
) -> InterpResult<'tcx> { ... }
fn ensure_not_failed(
&self,
socket: &FileDescriptionRef<Socket>,
foreign_name: &'static str,
) -> InterpResult<'tcx> { ... }
fn update_last_error(&self, socket: &FileDescriptionRef<Socket>) { ... }
}Provided Methods§
Sourcefn block_for_accept(
&mut self,
socket: FileDescriptionRef<Socket>,
address_ptr: Pointer,
address_len_ptr: Pointer,
is_client_sock_nonblock: bool,
dest: MPlaceTy<'tcx>,
) -> InterpResult<'tcx>
fn block_for_accept( &mut self, socket: FileDescriptionRef<Socket>, address_ptr: Pointer, address_len_ptr: Pointer, is_client_sock_nonblock: bool, dest: MPlaceTy<'tcx>, ) -> InterpResult<'tcx>
Block the thread until there’s an incoming connection or an error occurred.
This recursively calls itself should the operation still block for some reason.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Listening.
Sourcefn try_non_block_accept(
&mut self,
socket: &FileDescriptionRef<Socket>,
address_ptr: Pointer,
address_len_ptr: Pointer,
is_client_sock_nonblock: bool,
) -> InterpResult<'tcx, Result<i32, IoError>>
fn try_non_block_accept( &mut self, socket: &FileDescriptionRef<Socket>, address_ptr: Pointer, address_len_ptr: Pointer, is_client_sock_nonblock: bool, ) -> InterpResult<'tcx, Result<i32, IoError>>
Attempt to accept an incoming connection on the listening socket in a non-blocking manner.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Listening.
Sourcefn block_for_send(
&mut self,
socket: FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
) -> InterpResult<'tcx>
fn block_for_send( &mut self, socket: FileDescriptionRef<Socket>, buffer_ptr: Pointer, length: usize, finish: DynMachineCallback<'tcx, Result<usize, IoError>>, ) -> InterpResult<'tcx>
Block the thread until we can send bytes into the connected socket or an error occurred.
This recursively calls itself should the operation still block for some reason.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Connected.
Sourcefn try_non_block_send(
&mut self,
socket: &FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
) -> InterpResult<'tcx, Result<usize, IoError>>
fn try_non_block_send( &mut self, socket: &FileDescriptionRef<Socket>, buffer_ptr: Pointer, length: usize, ) -> InterpResult<'tcx, Result<usize, IoError>>
Attempt to send bytes into the connected socket in a non-blocking manner.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Connected.
Sourcefn block_for_recv(
&mut self,
socket: FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
should_peek: bool,
finish: DynMachineCallback<'tcx, Result<usize, IoError>>,
) -> InterpResult<'tcx>
fn block_for_recv( &mut self, socket: FileDescriptionRef<Socket>, buffer_ptr: Pointer, length: usize, should_peek: bool, finish: DynMachineCallback<'tcx, Result<usize, IoError>>, ) -> InterpResult<'tcx>
Block the thread until we can receive bytes from the connected socket or an error occurred.
This recursively calls itself should the operation still block for some reason.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Connected.
Sourcefn try_non_block_recv(
&mut self,
socket: &FileDescriptionRef<Socket>,
buffer_ptr: Pointer,
length: usize,
should_peek: bool,
) -> InterpResult<'tcx, Result<usize, IoError>>
fn try_non_block_recv( &mut self, socket: &FileDescriptionRef<Socket>, buffer_ptr: Pointer, length: usize, should_peek: bool, ) -> InterpResult<'tcx, Result<usize, IoError>>
Attempt to receive bytes from the connected socket in a non-blocking manner.
Note: This function is only safe to call when having previously ensured
that the socket is in SocketState::Connected.
Sourcefn ensure_connected(
&mut self,
socket: FileDescriptionRef<Socket>,
should_wait: bool,
foreign_name: &'static str,
action: DynMachineCallback<'tcx, Result<(), ()>>,
) -> InterpResult<'tcx>
fn ensure_connected( &mut self, socket: FileDescriptionRef<Socket>, should_wait: bool, foreign_name: &'static str, action: DynMachineCallback<'tcx, Result<(), ()>>, ) -> InterpResult<'tcx>
If the socket is currently neither in the SocketState::Connecting nor
the SocketState::Connecting state, Err is returned.
When the callback function is called with Ok, then we’re guaranteed
that the socket is in the SocketState::Connected state.
This method internally calls ensure_not_failed and thus an unsupported
error is thrown should socket be in SocketState::ConnectionFailed.
This function can optionally also block until either an error occurred or
the socket reached the SocketState::Connected state.
Sourcefn ensure_not_failed(
&self,
socket: &FileDescriptionRef<Socket>,
foreign_name: &'static str,
) -> InterpResult<'tcx>
fn ensure_not_failed( &self, socket: &FileDescriptionRef<Socket>, foreign_name: &'static str, ) -> InterpResult<'tcx>
Ensure that socket is not in the SocketState::ConnectionFailed state.
If socket is currently in SocketState::ConnectionFailed, an unsupported
error is thrown.
Sourcefn update_last_error(&self, socket: &FileDescriptionRef<Socket>)
fn update_last_error(&self, socket: &FileDescriptionRef<Socket>)
Check whether the underlying host socket of socket contains an error.
If there is an error, we store it in socket.error.
Should socket be in the SocketState::Connecting state whilst there is
an error on the host socket, we transition into the SocketState::ConnectionFailed
state because we know that socket can no longer successfully establish a
connection.