Skip to content

Commit

Permalink
is this defunct?
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity committed Jul 26, 2024
1 parent a6d7c89 commit 0560a7f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/dfx/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const DECIMAL_POINT: char = '.';
// thus, we need to recreate SocketAddr with the kernel-provided dynamically allocated port here.
// TcpBuilder is used with reuse_address and reuse_port set to "true" because
// the Actix HttpServer in webserver.rs will bind to this SocketAddr.
#[context("Failed to find reusable socket address")]
#[context("Failed to find available socket address")]
pub fn get_reusable_socket_addr(ip: IpAddr, port: u16) -> DfxResult<SocketAddr> {
let socket = if ip.is_ipv4() {
Socket::new(Domain::IPV4, socket2::Type::STREAM, None)
Expand All @@ -43,14 +43,6 @@ pub fn get_reusable_socket_addr(ip: IpAddr, port: u16) -> DfxResult<SocketAddr>
Socket::new(Domain::IPV6, socket2::Type::STREAM, None)
.context("Failed to create IPv6 socket.")?
};
socket
.set_reuse_address(true)
.context("Failed to set option reuse_address of tcp builder.")?;
// On Windows, SO_REUSEADDR without SO_EXCLUSIVEADDRUSE acts like SO_REUSEPORT (among other things), so this is only necessary on *nix.
#[cfg(unix)]
socket
.set_reuse_port(true)
.context("Failed to set option reuse_port of tcp builder.")?;
socket
.set_linger(Some(Duration::from_secs(10)))
.context("Failed to set linger duration of tcp listener.")?;
Expand Down

0 comments on commit 0560a7f

Please sign in to comment.