Reorg endpoint, fix flaky test, fix Host
Ipv6 parse and display
#76
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.
I'm trying to break up #72 to be a bit smaller, so I've manually extracted some of the changes from there to this separate PR.
This PR reorganizes the endpoint module to break it up into a few submodules. This helps readability and makes it easier to navigate that code.
I've also fixed some issues with how endpoints and hosts displayed and parsed IPV6 addresses. I've reworked the semantics of
Host::Ipv6
to more closely match the semantics ofstd::net::Ipv6Addr
, and added associated tests. This removes the need for theformat!("{}:{}", host, port)
that I was doing whenever I passed a host and port tuple to tokio, and correspondingly fixes the bugs in the parts of the code that weren't using that.I also fixed a flaky test - as mentioned in #73, our sockets are not yet resistant to ordering issues when connecting to an endpoint that might not yet be bound. For this reason, we now
await
until the pub socket has finished binding in thepub_sub
test