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

Method blocking_bind

crates/test-programs/src/sockets.rs:123–139  ·  view source on GitHub ↗
(
        &self,
        network: &Network,
        local_address: IpSocketAddress,
    )

Source from the content-addressed store, hash-verified

121 }
122
123 pub fn blocking_bind(
124 &self,
125 network: &Network,
126 local_address: IpSocketAddress,
127 ) -> Result<(), ErrorCode> {
128 let timeout = monotonic_clock::subscribe_duration(TIMEOUT_NS);
129 let sub = self.subscribe();
130
131 self.start_bind(&network, local_address)?;
132
133 loop {
134 match self.finish_bind() {
135 Err(ErrorCode::WouldBlock) => sub.block_until(&timeout)?,
136 result => return result,
137 }
138 }
139 }
140
141 pub fn blocking_listen(&self) -> Result<(), ErrorCode> {
142 let timeout = monotonic_clock::subscribe_duration(TIMEOUT_NS);

Callers 15

test_tcp_busy_pollFunction · 0.80
mainFunction · 0.80
test_tcp_bind_addrinuseFunction · 0.80
test_tcp_bind_reuseaddrFunction · 0.80
setupFunction · 0.80

Calls 4

block_untilMethod · 0.80
subscribeMethod · 0.45
start_bindMethod · 0.45
finish_bindMethod · 0.45