Block until a connection is accepted.
(&mut self)
| 46 | impl 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( |
no test coverage detected