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

Function free_port

tests/all/guest_debug/mod.rs:34–40  ·  view source on GitHub ↗

Find an available TCP port by binding to port 0.

()

Source from the content-addressed store, hash-verified

32
33/// Find an available TCP port by binding to port 0.
34fn free_port() -> u16 {
35 TcpListener::bind("127.0.0.1:0")
36 .unwrap()
37 .local_addr()
38 .unwrap()
39 .port()
40}
41
42/// Path to the wasm-aware LLDB.
43fn lldb_path() -> String {

Callers 4

guest_debug_cli_fib_stepFunction · 0.85

Calls 2

portMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected