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

feat: support so_reuseaddr #280

Merged
merged 2 commits into from
Nov 23, 2021
Merged

feat: support so_reuseaddr #280

merged 2 commits into from
Nov 23, 2021

Conversation

zhongweikang
Copy link
Contributor

1. Are you opening this pull request for bug-fixes, optimizations or new feature?

new feature

2. Please describe how these code changes achieve your intention.

支持 so_reuseaddr 可以使得 gnet 在重启过程中,不必因为 timewait 原因而导致:bind: address already in use

3. Please link to the relevant issues (if any).

ISSUES #266
ISSUES #272
PR #275

4. Which documentation changes (if any) need to be made/updated because of this PR?

4. Checklist

  • I have squashed all insignificant commits.
  • I have commented my code for explaining package types, values, functions, and non-obvious lines.
  • I have written unit tests and verified that all tests passes (if needed).
  • I have documented feature info on the README (only when this PR is adding a new feature).
  • (optional) I am willing to help maintain this change if there are issues with it later.

@zhongweikang
Copy link
Contributor Author

已重开,这次ok么?

@codecov
Copy link

codecov bot commented Nov 22, 2021

Codecov Report

Merging #280 (b52e1b3) into dev (c71b023) will increase coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev     #280      +/-   ##
==========================================
+ Coverage   80.36%   80.49%   +0.13%     
==========================================
  Files          19       19              
  Lines        1884     1892       +8     
==========================================
+ Hits         1514     1523       +9     
+ Misses        301      300       -1     
  Partials       69       69              
Flag Coverage Δ
unittests 80.49% <100.00%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
listener_unix.go 100.00% <100.00%> (ø)
options.go 89.18% <100.00%> (+0.61%) ⬆️
connection_unix.go 76.50% <0.00%> (+0.60%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c71b023...b52e1b3. Read the comment docs.

gnet_test.go Outdated
@@ -226,6 +246,7 @@ func testCodecServe(
multicore, async bool,
nclients int,
reuseport bool,
reuseaddr bool,
Copy link
Owner

Choose a reason for hiding this comment

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

testCodecServe 这个测试里不需要加 reuseaddr 的测试,这里 reuseport 是需要测试不同线程模型,reuseaddr 不需要,所以麻烦这部分测试去掉。

@zhongweikang
Copy link
Contributor Author

Done

Copy link
Owner

@panjf2000 panjf2000 left a comment

Choose a reason for hiding this comment

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

lgtm

@panjf2000 panjf2000 merged commit f7a3ada into panjf2000:dev Nov 23, 2021
0-haha pushed a commit to 0-haha/gnet that referenced this pull request Jan 25, 2023
Fixes panjf2000#266 
Fixes panjf2000#272 

Co-authored-by: zhongweikang <zhongweikang@sfmail.sf-express.com>
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.

None yet

2 participants