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

Auto-resolve addresses in socket methods #377

Closed
njsmith opened this issue Dec 20, 2017 · 0 comments
Closed

Auto-resolve addresses in socket methods #377

njsmith opened this issue Dec 20, 2017 · 0 comments

Comments

@njsmith
Copy link
Member

njsmith commented Dec 20, 2017

Currently, one of the awkward differences between socket and trio.socket – really the last awkward difference as of v0.2.0 – is that with socket, you can pass hostnames directly to socket methods, like sock.bind(("localhost", 0)) or sock.connect(("python.org", 443)). In Trio these methods currently require numeric addresses, and there are the extra methods resolve_local_address and resolve_remote_address that do the resolution for you.

This was always a little weird, and really the only compelling reason was because bind as synchronous. But it turns out that bind should be async after all (#241). So we might as well get rid of this last piece of weirdness.

Plan:

  • Make bind, connect, etc. all call resolve_local_address/resolve_remote_address automatically as needed
  • Deprecate resolve_local_address/resolve_remote_address
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

No branches or pull requests

1 participant