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

Improve low-level TCP connection interface #102

Closed
eklitzke opened this issue Nov 22, 2017 · 3 comments
Closed

Improve low-level TCP connection interface #102

eklitzke opened this issue Nov 22, 2017 · 3 comments

Comments

@eklitzke
Copy link

eklitzke commented Nov 22, 2017

I have an application that needs to do the following:

  • Resolve a DNS name
  • Try to connect to all the resolved addresses (until one succeeds)

This is currently difficult to do with the API exposed by uvw. The DNS interface is just fine, but I think the TCP connect methods need some work. Specifically, the TCP::connect methods take a string name, and only connect to the first resolved name.

Right now I've just kind of copied the logic from TCP::connect in my own application, which works but is kind of ugly (in my opinion). A cleaner way to do this would be to add a new TCP::connect overloaded method that accepts a pointer/reference to a struct addrinfo.

@skypjack
Copy link
Owner

I'm out of home until Sunday. I'll look into the issue next week probably.
I'm sorry for the inconvenience.

@skypjack
Copy link
Owner

Let me know if it works for you. It's on branch wip.
If it's fine, I can merge it on master and close the issue.

@skypjack
Copy link
Owner

Available on master.

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

2 participants