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: make it possible to try several sockaddrs when starting server #567

Merged
merged 5 commits into from
Nov 17, 2021

Conversation

niklasad1
Copy link
Member

Closing #562

/// let server = builder.build(addrs).unwrap();
/// }
/// ```
pub fn build(self, addrs: impl ToSocketAddrs) -> Result<Server, Error> {
Copy link
Member Author

Choose a reason for hiding this comment

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

NOTE: this is std::net::ToSocketAddrs because tokio::std::ToSocketAddrs is sealed i.e, doesn't provide to_socket_addrs because we configure the Socket ourselves with some settings.

http-server/src/server.rs Outdated Show resolved Hide resolved
@niklasad1 niklasad1 changed the title feat: enable several sockaddress when starting servers feat: make it possible to try several sockaddress when starting server Nov 16, 2021
Copy link
Contributor

@dvdplm dvdplm left a comment

Choose a reason for hiding this comment

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

This lgtm. It would be nice to have a test for this though?

@niklasad1 niklasad1 changed the title feat: make it possible to try several sockaddress when starting server feat: make it possible to try several sockaddresses when starting server Nov 17, 2021
@niklasad1
Copy link
Member Author

This lgtm. It would be nice to have a test for this though?

I added a test in the rust docs should be sufficient?
Port 10 doesn't work if you are not running in ordinary user mode

Copy link
Contributor

@maciejhirsz maciejhirsz left a comment

Choose a reason for hiding this comment

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

Just one tiny nit on doc comments.

http-server/src/server.rs Outdated Show resolved Hide resolved
@niklasad1 niklasad1 changed the title feat: make it possible to try several sockaddresses when starting server feat: make it possible to try several sockaddrs when starting server Nov 17, 2021
@niklasad1 niklasad1 merged commit e2d4722 into master Nov 17, 2021
@niklasad1 niklasad1 deleted the na-fix-562 branch November 17, 2021 10:29
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