2022年7月21日

Rust find an available tcp port 获取一个可用的 TCP 端口

摘要: fn get_available_port() -> u16 { std::net::TcpListener::bind("0.0.0.0:0") .unwrap() .local_addr() .unwrap() .port() } TcpListener::bind() 函数内部会调用 c::b 阅读全文

posted @ 2022-07-21 18:41 明天有风吹 阅读(398) 评论(0) 推荐(1) 编辑

导航

+V atob('d2h5X251bGw=')

请备注:from博客园