Skip to content

Conversation

@panjf2000
Copy link
Contributor

DragonFly BSD changed the time unit for TCP keep-alive from milliseconds to seconds since v5.8 and Solaris 11.4 added TCP_KEEPIDLE, TCP_KEEPINTVL, and TCP_KEEPCNT with time units in second while Solaris <11.4 still use TCP_KEEPALIVE_THRESHOLD and TCP_KEEPALIVE_ABORT_THRESHOLD with time units in millisecond.

Currently, we don't differentiate among DragonFly BSD versions but set the keepalive options with seconds, which will result in unexpected behaviors on DragonFlyBSD <5.8. This PR intends to fix the wrong usage of time units of TCP keepalive options on DragonFly BSD <5.8 and consolidate the logic of time units conversion for TCP keepalive across platforms.

In addition, this PR introduces a new custom macro for determining Solaris 11.4. This macro is expected to help us implement some new features for libuv using some abilities that only exist on Solaris 11.4 and other mainstream platforms in the future, considering that Oracle developed and released Solaris 11.4 to replenish plenty of features on Solaris that have already been implemented on other UNIX-like OSs but missing from Solaris <11.4, also bring a good deal of new features.

References

@panjf2000
Copy link
Contributor Author

This PR has code conflicts with #4419, we might want to merge #4419 first.

/cc @saghul @santigimeno

Copy link
Member

@saghul saghul left a comment

Choose a reason for hiding this comment

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

Nice!

@panjf2000
Copy link
Contributor Author

Ping @libuv/collaborators

@panjf2000
Copy link
Contributor Author

Kindly ping @santigimeno

---------

Signed-off-by: Andy Pan <i@andypan.me>
@panjf2000
Copy link
Contributor Author

@santigimeno got a minute for this?

@saghul saghul merged commit fedfa98 into libuv:v1.x Jun 27, 2024
@saghul
Copy link
Member

saghul commented Jun 27, 2024

Cheers!

@panjf2000 panjf2000 deleted the tcp-keepalive-ms branch June 27, 2024 14:53
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.

3 participants