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

Add net.TCPConnection & remove TCPIPConnection #1414

Merged
merged 4 commits into from
Aug 15, 2023
Merged

Conversation

plajjan
Copy link
Contributor

@plajjan plajjan commented Aug 5, 2023

This adds a new TCP client connection actor which replaces the older TCPIPConnection actor. It improves on the old implementation through the addition of DNS resolution and Happy Eyeballs (RFC6555).

While not super complex it is non-trivial compared to the old connection actor and so there are probably bugs lurking. More test cases are needed.

Right now we do a rather aggressive Happy Eyeballs where we instantly connect both to IPv4 and IPv6. This effectively doubles the resources consumed, fds on our end and more on the server side. While the RFC allows for this, the recommendation is to have a slight delay for the IPv4 side, like I think Chrome does 300ms or so. We can look into that.

Added net.is_ipv4() and net.is_ipv6() as well.

This adds a new TCP client connection actor which replaces the older
TCPIPConnection actor. It improves on the old implementation through the
addition of DNS resolution and Happy Eyeballs (RFC6555).

While not super complex it is non-trivial compared to the old connection
actor and so there are probably bugs lurking. More test cases are needed.

Right now we do a rather aggressive Happy Eyeballs where we instantly
connect both to IPv4 and IPv6. This effectively doubles the resources
consumed, fds on our end and more on the server side. While the RFC
allows for this, the recommendation is to have a slight delay for the
IPv4 side, like I think Chrome does 300ms or so. We can look into that.

Added net.is_ipv4() and net.is_ipv6() as well.

Originally had ideas about just adding this and letting the older
TCPIPConnection remain but as we've made backwards incompatible changes
anyway, it's just easier to replace it right away.
Need to exit *after* we've printed the output, duh, what a typo.
A connection now times out after 10 seconds after which the on_error
callback will be called.

10 seconds seems fairly long but mobile clients (or from an airplane!)
or similar could sometimes suffer from very long latency and better late
than never?
The TCPListener can now listen to an IPv4 or IPv6 address!

Added a test case for it as well but it is unfortunately disabled since
the CI environment currently does not support IPv6 (GitHub Actions do
not do IPv6 for docker containers).
@plajjan plajjan merged commit aee7bde into main Aug 15, 2023
24 checks passed
@plajjan plajjan deleted the net-tcpconnection branch August 15, 2023 09:04
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.

1 participant