Skip to content

net: add reuse_address option to StreamServer #3820

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

Closed
wants to merge 10 commits into from

Conversation

lun-4
Copy link
Contributor

@lun-4 lun-4 commented Dec 1, 2019

  • add std.os.setsockopt
  • "fix" setsockopt / getsockopt in std.c so their parameters align with the linux syscall parameters

this uses a bad direct interface with std.os.linux, this should add
setsockopt to std.os.
 - net: use os.setsockopt()
 - os: fix typos on setsockopt
this makes them consistent with the linux syscalls
@lun-4 lun-4 marked this pull request as ready for review December 1, 2019 15:24
Copy link
Contributor

@daurnimator daurnimator left a comment

Choose a reason for hiding this comment

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

I wouldn't mind per-sock-opt wrappers e.g. pub fn setReuseAddr() !void.
These probably belong on some sort of socket object though.

@lun-4 lun-4 requested a review from daurnimator December 29, 2019 23:20
Copy link
Member

@andrewrk andrewrk left a comment

Choose a reason for hiding this comment

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

The API improvements look good 👍

I want to make sure the error set for std.os.setsockopt is correct since it's a public part of std.os API, and then this is good to merge.

@lun-4 lun-4 requested a review from andrewrk December 30, 2019 15:44
@andrewrk andrewrk closed this in 86ba8c0 Dec 31, 2019
@andrewrk
Copy link
Member

Landed in 86ba8c0, thanks!

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