1
0
mirror of https://github.com/fafhrd91/actix-net synced 2025-06-28 15:40:36 +02:00

testing: Bump up to 1.0.1

This commit is contained in:
Yuki Okushi
2020-05-19 14:08:08 +09:00
parent 2d2b0591a2
commit d0b27ee7e6
3 changed files with 7 additions and 3 deletions

View File

@ -110,7 +110,8 @@ impl TestServer {
/// Get firat available unused local address
pub fn unused_addr() -> net::SocketAddr {
let addr: net::SocketAddr = "127.0.0.1:0".parse().unwrap();
let socket = Socket::new(Domain::ipv4(), Type::stream(), Some(Protocol::tcp())).unwrap();
let socket =
Socket::new(Domain::ipv4(), Type::stream(), Some(Protocol::tcp())).unwrap();
socket.bind(&addr.into()).unwrap();
socket.set_reuse_address(true).unwrap();
let tcp = socket.into_tcp_listener();