1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 09:42:40 +01:00

Merge pull request #90 from rvlzzr/master

move reuse_address before bind
This commit is contained in:
Nikolay Kim 2018-03-02 23:08:33 -08:00 committed by GitHub
commit 8f94ae41cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -697,7 +697,7 @@ fn create_tcp_listener(addr: net::SocketAddr, backlog: i32) -> io::Result<net::T
net::SocketAddr::V4(_) => TcpBuilder::new_v4()?, net::SocketAddr::V4(_) => TcpBuilder::new_v4()?,
net::SocketAddr::V6(_) => TcpBuilder::new_v6()?, net::SocketAddr::V6(_) => TcpBuilder::new_v6()?,
}; };
builder.bind(addr)?;
builder.reuse_address(true)?; builder.reuse_address(true)?;
builder.bind(addr)?;
Ok(builder.listen(backlog)?) Ok(builder.listen(backlog)?)
} }