Comments (5)
Also, I think it would be nice to put the wrapper function inside the dns module. Having to use the driver directly seems against the spirit of this library.
from io.
Hence it's private. I tried a couple of things, but getaddrinfo is really only designed to open a socket. On the good side, it can transparently handle IPv4 vs. IPv6 and multiple IPs if used correctly.
DNS isn't a hostname -> addr mapping. And what would you do with a list of addresses of different families?
My takeaway was to use the C resolver for sockets, but leave DNS to some other library. A real DNS library would also support other queries like MX, TXT, et.al.
This reasoning should be properly documented somewhere.
from io.
What's the use-case for a manual DNS resolution of the hostname @schveiguy?
Resolving names once on program startup is somewhat of an anti-pattern as it defies certain server-side failover/loadbalancer mechanisms (hence TTL in caching in recursive resolvers).
Also sockets can be used over longer times, so repeated lookup shouldn't be too much of a problem, and most ppl. have caching resolvers nearby anyhow.
from io.
Hence it's private
Huh? I was able to use it here: https://github.com/schveiguy/httpiopipe/blob/master/source/iopipe/http.d#L591
DNS isn't a hostname -> addr mapping
I have no idea what you mean by this statement. What other service would I use to open a socket to a named host?
I think there's a misunderstanding here. I'm not complaining about the service or the usage of getaddrinfo, just that I have to use the driver directly (which is completely different from most of std.io), and that the API requires me to write my code in a node.js callback style of code.
from io.
What's the use-case for a manual DNS resolution of the hostname @schveiguy?
Resolving names once on program startup is somewhat of an anti-pattern as it defies certain server-side failover/loadbalancer mechanisms (hence TTL in caching in recursive resolvers).
Also sockets can be used over longer times, so repeated lookup shouldn't be too much of a problem, and most ppl. have caching resolvers nearby anyhow.
Literally, I have no idea why you wrote any of this. I really do feel you are reading some other meaning than what I wanted to say.
from io.
Related Issues (20)
- Sockets can't be moved HOT 3
- Need a way to close a socket read or write part individually HOT 3
- can't build on windows with dmd 2.086.0 HOT 2
- Provide a EOF function HOT 1
- Add pipe handling.
- Add Unix Socket support
- Add async driver
- Build failure, dmd 2.088: cast from int to void* not allowed in safe code HOT 17
- Add to project tester for dmd HOT 2
- Github pages
- dmd 2.089.0 reports error
- Doc publish authentication doesn't work HOT 1
- Appveyor should be updated to the latest version of DMD
- String.clone is unsafe HOT 3
- Drive the accepted socket from a separate thread HOT 7
- Setting SO_NOSIGPIPE on Socket for BSD derivatives HOT 1
- Take ownership unused?
- Add me to AppVeyor controls
- Use with a growing buffer HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from io.