Skip to content

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

Closed
epilys wants to merge 1 commit intorust-lang:masterfrom
epilys:master
Closed

Add KEEPALIVE_TIME for haiku and openbsd (compilation was broken)#263
epilys wants to merge 1 commit intorust-lang:masterfrom
epilys:master

Conversation

@epilys
Copy link
Copy Markdown

@epilys epilys commented Sep 3, 2021

No description provided.

@Thomasdezeeuw
Copy link
Copy Markdown
Collaborator

Thomasdezeeuw commented Sep 3, 2021

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

@Thomasdezeeuw
Copy link
Copy Markdown
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