Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
3d30c985
"src/zipmap.c" did not exist on "da2cfe8a3baeaad619c11290acf377f4ea7356c1"
Commit
3d30c985
authored
Jul 27, 2019
by
Nathaniel Wesley Filardo
Committed by
Marcel Stör
Jul 27, 2019
Browse files
Clarify DNS callbacks (#2860)
parent
73e6651f
Changes
1
Show whitespace changes
Inline
Side-by-side
docs/modules/net.md
View file @
3d30c985
...
@@ -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`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment