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

Condition linux TCP keepalive sockopts #202

Closed

Conversation

plajjan
Copy link
Contributor

@plajjan plajjan commented Feb 11, 2024

It's specific for Linux, so condition it on linux.

This change was introduced rather recently and I presume no one attempted to compile it on anything that's not Linux. It would be great with cross-platform CI builds to catch things like this...

It's specific for Linux, so condition it on __linux__
@@ -169,8 +169,10 @@ int tlsuv_stream_keepalive(tlsuv_stream_t *clt, int keepalive, unsigned int dela
#if defined(TCP_KEEPALIVE)
setsockopt(s, IPPROTO_TCP, TCP_KEEPALIVE, &delay, sizeof(delay));
#endif
#if __linux__
Copy link
Member

@ekoby ekoby Feb 22, 2024

Choose a reason for hiding this comment

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

it would be better to condition on the macro definitions -- TCP_KEEPINTVL and TCP_KEEPCNT

those options are NOT linux exclusive:
https://learn.microsoft.com/en-us/windows/win32/winsock/ipproto-tcp-socket-options

see above

@ekoby
Copy link
Member

ekoby commented Mar 19, 2024

dup #212

@ekoby ekoby closed this Mar 19, 2024
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