MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / accept

Method accept

vmm/src/migration_transport.rs:48–61  ·  view source on GitHub ↗

Block until a connection is accepted.

(&mut self)

Source from the content-addressed store, hash-verified

46impl ReceiveListener {
47 /// Block until a connection is accepted.
48 pub(crate) fn accept(&mut self) -> Result<SocketStream, MigratableError> {
49 match self {
50 ReceiveListener::Tcp(listener) => listener
51 .accept()
52 .map(|(socket, _)| SocketStream::Tcp(socket))
53 .context("Failed to accept TCP migration connection")
54 .map_err(MigratableError::MigrateReceive),
55 ReceiveListener::Unix(listener) => listener
56 .accept()
57 .map(|(socket, _)| SocketStream::Unix(socket))
58 .context("Failed to accept Unix migration connection")
59 .map_err(MigratableError::MigrateReceive),
60 }
61 }
62
63 /// Same as [`Self::accept`], but returns `None` if the abort event was signaled.
64 fn abortable_accept(

Callers 5

vm_receive_migrationMethod · 0.45
gdb_threadFunction · 0.45
abortable_acceptMethod · 0.45
start_threadMethod · 0.45
wait_vm_boot_fromMethod · 0.45

Calls 2

contextMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected