-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
TCP Keep Alive Control #1395
TCP Keep Alive Control #1395
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1395 +/- ##
==========================================
- Coverage 39.62% 39.58% -0.04%
==========================================
Files 598 598
Lines 35029 35064 +35
==========================================
+ Hits 13879 13881 +2
- Misses 19633 19660 +27
- Partials 1517 1523 +6
Continue to review full report at Codecov.
|
transport/internet/sockopt_darwin.go
Outdated
@@ -10,7 +10,8 @@ const ( | |||
// TCP_FASTOPEN_SERVER is the value to enable TCP fast open on darwin for server connections. | |||
TCP_FASTOPEN_SERVER = 0x01 // nolint: golint,stylecheck | |||
// TCP_FASTOPEN_CLIENT is the value to enable TCP fast open on darwin for client connections. | |||
TCP_FASTOPEN_CLIENT = 0x02 // nolint: golint,stylecheck | |||
TCP_FASTOPEN_CLIENT = 0x02 // nolint: golint,stylecheck | |||
TCP_KEEPINTVL = 0x101 // nolint: golint,stylecheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not necessary, see https://pkg.go.dev/golang.org/x/sys/unix?GOOS=darwin.
The
|
Okay, I will rewrite these code to use unix instead of syscall. |
Suggestion from: #1395 (comment)
Suggestion from: #1395 (comment)
Suggestion from: #1395 (comment)
Suggestion from: #1395 (comment)
66ed928
to
aa2b82e
Compare
Suggestion from: #1395 (comment)
Unfortunately this patchset does not handle keep-alive on |
Oh wait, the patch hasn't been backported to v4. |
Suggestion from: #1395 (comment)
Suggestion from: #1395 (comment)
Suggestion from: v2fly/v2ray-core#1395 (comment)
Suggestion from: v2fly/v2ray-core#1395 (comment)
* Add TCP keep alive idle setting * Add TCP keep alive idle setting: auto generated * Add TCP keep alive support in Linux * Add TCP keep alive support in MacOS, FreeBSD * Add TCP keep alive support in Windows * fix bug introduced in adding tcp keep alive adjustment * embed macOS const to avoid platform inconsistency * embed macOS const to avoid platform inconsistency(again) * add TCP Keep Alive support in config * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * Separate TcpKeepAliveIdle and TcpKeepAliveInterval check logic * Disable tcp keepAlive when TcpKeepAliveIdle < 0 and TcpKeepAliveInterval <= 0 Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com> Co-authored-by: ValdikSS <iam@valdikss.org.ru> Co-authored-by: Shelikhoo <xiaokangwang@outlook.com> Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com>
* Add TCP keep alive idle setting * Add TCP keep alive idle setting: auto generated * Add TCP keep alive support in Linux * Add TCP keep alive support in MacOS, FreeBSD * Add TCP keep alive support in Windows * fix bug introduced in adding tcp keep alive adjustment * embed macOS const to avoid platform inconsistency * embed macOS const to avoid platform inconsistency(again) * add TCP Keep Alive support in config * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * Separate TcpKeepAliveIdle and TcpKeepAliveInterval check logic * Disable tcp keepAlive when TcpKeepAliveIdle < 0 and TcpKeepAliveInterval <= 0 Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com> Co-authored-by: ValdikSS <iam@valdikss.org.ru> Co-authored-by: Shelikhoo <xiaokangwang@outlook.com> Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com>
* Add TCP keep alive idle setting * Add TCP keep alive idle setting: auto generated * Add TCP keep alive support in Linux * Add TCP keep alive support in MacOS, FreeBSD * Add TCP keep alive support in Windows * fix bug introduced in adding tcp keep alive adjustment * embed macOS const to avoid platform inconsistency * embed macOS const to avoid platform inconsistency(again) * add TCP Keep Alive support in config * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * Separate TcpKeepAliveIdle and TcpKeepAliveInterval check logic * Disable tcp keepAlive when TcpKeepAliveIdle < 0 and TcpKeepAliveInterval <= 0 Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com> Co-authored-by: ValdikSS <iam@valdikss.org.ru> Co-authored-by: Shelikhoo <xiaokangwang@outlook.com> Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com>
* Add TCP keep alive idle setting * Add TCP keep alive idle setting: auto generated * Add TCP keep alive support in Linux * Add TCP keep alive support in MacOS, FreeBSD * Add TCP keep alive support in Windows * fix bug introduced in adding tcp keep alive adjustment * embed macOS const to avoid platform inconsistency * embed macOS const to avoid platform inconsistency(again) * add TCP Keep Alive support in config * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * use sys/unix instead of syscall Suggestion from: v2fly/v2ray-core#1395 (comment) * Separate TcpKeepAliveIdle and TcpKeepAliveInterval check logic * Disable tcp keepAlive when TcpKeepAliveIdle < 0 and TcpKeepAliveInterval <= 0 Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com> Co-authored-by: ValdikSS <iam@valdikss.org.ru> Co-authored-by: Shelikhoo <xiaokangwang@outlook.com> Co-authored-by: xqzr <34030394+xqzr@users.noreply.github.com>
This is a reworked PR of #1276.