Commit 3d30c985 authored by Nathaniel Wesley Filardo's avatar Nathaniel Wesley Filardo Committed by Marcel Stör
Browse files

Clarify DNS callbacks (#2860)

parent 73e6651f
...@@ -236,6 +236,10 @@ Provides DNS resolution for a hostname. ...@@ -236,6 +236,10 @@ Provides DNS resolution for a hostname.
- `domain` domain name - `domain` domain name
- `function(net.socket, ip)` callback function. The first parameter is the socket, the second parameter is the IP address as a string. - `function(net.socket, ip)` callback function. The first parameter is the socket, the second parameter is the IP address as a string.
If a callback `c` is provided, it is equivalent to having called `:on("dns",
c)` on this socket; this callback will, hereafter, receive any pending
resolution results recieved for this socket!
#### Returns #### Returns
`nil` `nil`
...@@ -580,6 +584,11 @@ Resolve a hostname to an IP address. Doesn't require a socket like [`net.socket. ...@@ -580,6 +584,11 @@ Resolve a hostname to an IP address. Doesn't require a socket like [`net.socket.
- `host` hostname to resolve - `host` hostname to resolve
- `function(sk, ip)` callback called when the name was resolved. `sk` is always `nil` - `function(sk, ip)` callback called when the name was resolved. `sk` is always `nil`
There is at most one callback for all `net.dns.resolve()` requests at any time;
all resolution results are sent to the most recent callback specified at time
of receipt! If multiple DNS callbacks are needed, associate them with separate
sockets using [`net.socket:dns()`](#netsocketdns).
#### Returns #### Returns
`nil` `nil`
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment