feat(ext/net): Use Socket2 crate to create TcpListener #13808
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a first attempt in solving #1195 in #13794, it has been noticed that the SO_REUSEADDR option has to be defaulted to true in order to pass the
net
unit tests. In the same PR was proposed to do the porting to Socket2 and the support to the options SO_REUSEADDR and SO_REUSEPORT in two separate PR. This PR presents the TcpListener implementation based on Socket2.It is possible to notice that:
TcpListener.bind()
of std::netSOCK_STREAM
and thebacklog
argument oflisten()
is set to 128These steps should produce a TcpListener equal to the one produce by the instruction
std::net::TcpListener::bind(&addr)?;