Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dial: use OS defaults for TCP keepalive params #606

Merged
merged 1 commit into from
Dec 18, 2023
Merged

Conversation

mmatczuk
Copy link
Contributor

Fixes #605

@mmatczuk mmatczuk force-pushed the mmt/tcp_keepalive branch 3 times, most recently from cfe1cbe to a69792a Compare December 15, 2023 15:18
dial_windows.go Outdated
d.Control = func(network, address string, c syscall.RawConn) error {
return c.Control(func(fd uintptr) {
optval := (*byte)(unsafe.Pointer(&[4]byte{1}))
if err := windows.Setsockopt(windows.Handle(fd), windows.SOL_SOCKET, windows.SO_KEEPALIVE, optval, 1); err != nil {
Copy link
Contributor

@Choraden Choraden Dec 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can it be SetsockoptInt as in unix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point.

@mmatczuk mmatczuk merged commit 519bae1 into main Dec 18, 2023
4 checks passed
@mmatczuk mmatczuk deleted the mmt/tcp_keepalive branch December 18, 2023 14:24
mmatczuk added a commit that referenced this pull request Dec 19, 2023
…ers to accepted connections

This is a followup to #606.
mmatczuk added a commit that referenced this pull request Dec 19, 2023
…ers to accepted connections

This is a followup to #606.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use OS defaults for TCP keepalive params
2 participants