Skip to content

Add KEEPALIVE_TIME for haiku and openbsd (compilation was broken) #263

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

Closed
wants to merge 1 commit into from
Closed

Conversation

epilys
Copy link

@epilys epilys commented Sep 3, 2021

No description provided.

@Thomasdezeeuw
Copy link
Collaborator

Thomasdezeeuw commented Sep 3, 2021

SO_KEEPALIVE is not the same as KEEPALIVE_TIME, also see #251.

@Thomasdezeeuw
Copy link
Collaborator

Oh. I read the manpage and it doesn't mention something like that.

KEEPALIVE_TIME is TCP_KEEPALIVE, thus on the TCP socket level, while SO_KEEPALIVE is on the more general socket level (SO).

Would returning an error be acceptable? Otherwise it won't build at all.

I'm afraid not, but we can remove the function from OpenBSD by using something like:

#[cfg(not(target_os = "openbsd"))]

on keepalive_time and set_keepalive_time.

And on sysctl(3) it mentions KEEPALIVE set on TCP sockets.

That is a boolean to enable keepalive, while KEEPALIVE_TIME sets a duration, see TCP_KEEPIDLE for Linux or TCP_KEEPALIVE for macOS.

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.

2 participants