Skip to content

Commit

Permalink
Run fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Mattix II <[email protected]>
  • Loading branch information
keithmattix committed Feb 21, 2025
1 parent 9b9d47c commit 3b6ea10
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/sys/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -735,10 +735,14 @@ pub(crate) fn set_tcp_keepalive(socket: Socket, keepalive: &TcpKeepalive) -> io:
keepaliveinterval: into_ms(keepalive.interval),
};


if let Some(retries) = keepalive.retries {
unsafe {
setsockopt(socket, WinSock::IPPROTO_TCP, WinSock::TCP_KEEPCNT, retries as c_int)?
setsockopt(
socket,
WinSock::IPPROTO_TCP,
WinSock::TCP_KEEPCNT,
retries as c_int,
)?
}
}
let mut out = 0;
Expand Down
2 changes: 2 additions & 0 deletions tests/socket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ fn tcp_keepalive() {
target_os = "netbsd",
target_os = "tvos",
target_os = "watchos",
target_os = "windows"
)
))]
let params = params.with_retries(10);
Expand Down Expand Up @@ -943,6 +944,7 @@ fn tcp_keepalive() {
target_os = "netbsd",
target_os = "tvos",
target_os = "watchos",
target_os = "windows",
)
))]
assert_eq!(socket.keepalive_retries().unwrap(), 10);
Expand Down

0 comments on commit 3b6ea10

Please sign in to comment.