MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / blocking_accept

Method blocking_accept

crates/test-programs/src/sockets.rs:173–183  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

171 }
172
173 pub fn blocking_accept(&self) -> Result<(TcpSocket, InputStream, OutputStream), ErrorCode> {
174 let timeout = monotonic_clock::subscribe_duration(TIMEOUT_NS);
175 let sub = self.subscribe();
176
177 loop {
178 match self.accept() {
179 Err(ErrorCode::WouldBlock) => sub.block_until(&timeout)?,
180 result => return result,
181 }
182 }
183 }
184}
185
186impl UdpSocket {

Callers 6

test_tcp_busy_pollFunction · 0.80
test_tcp_bind_reuseaddrFunction · 0.80
setupFunction · 0.80

Calls 3

block_untilMethod · 0.80
subscribeMethod · 0.45
acceptMethod · 0.45

Tested by 5

test_tcp_busy_pollFunction · 0.64
test_tcp_bind_reuseaddrFunction · 0.64