summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2013-03-07 14:10:47 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2013-03-07 14:11:46 +0100
commit924f603e26b450d83234781e80de95d76fcf251a (patch)
tree31b30596fd30f17adcd6679ba85773a7a26a4c31 /doc
parentf780c6f5989c9c33b1b0f0a885e29b4389a03655 (diff)
downloadandroid-node-v8-924f603e26b450d83234781e80de95d76fcf251a.tar.gz
android-node-v8-924f603e26b450d83234781e80de95d76fcf251a.tar.bz2
android-node-v8-924f603e26b450d83234781e80de95d76fcf251a.zip
doc: dgram: document bind() callback argument
Diffstat (limited to 'doc')
-rw-r--r--doc/api/dgram.markdown10
1 files changed, 7 insertions, 3 deletions
diff --git a/doc/api/dgram.markdown b/doc/api/dgram.markdown
index 2c52c5612e..bcc3dcae5b 100644
--- a/doc/api/dgram.markdown
+++ b/doc/api/dgram.markdown
@@ -108,13 +108,17 @@ a packet might travel, and that generally sending a datagram greater than
the (receiver) `MTU` won't work (the packet gets silently dropped, without
informing the source that the data did not reach its intended recipient).
-### dgram.bind(port, [address])
+### dgram.bind(port, [address], [callback])
* `port` Integer
* `address` String, Optional
+* `callback` Function, Optional
-For UDP sockets, listen for datagrams on a named `port` and optional `address`. If
-`address` is not specified, the OS will try to listen on all addresses.
+For UDP sockets, listen for datagrams on a named `port` and optional `address`.
+If `address` is not specified, the OS will try to listen on all addresses.
+
+The `callback` argument, if provided, is added as a one-shot `'listening'`
+event listener.
Example of a UDP server listening on port 41234: