summaryrefslogtreecommitdiff
path: root/doc/api/net.md
diff options
context:
space:
mode:
authorVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-04-11 21:07:14 +0300
committerVse Mozhet Byt <vsemozhetbyt@gmail.com>2018-04-12 03:18:01 +0300
commitdf5d41bf93a304af4159398d0d9f44f0cba4ac94 (patch)
tree83970afaa89bf7328b7491a680a62e2acf988a40 /doc/api/net.md
parent068c001dee01e8ac7401e97249c5f61215aed233 (diff)
downloadandroid-node-v8-df5d41bf93a304af4159398d0d9f44f0cba4ac94.tar.gz
android-node-v8-df5d41bf93a304af4159398d0d9f44f0cba4ac94.tar.bz2
android-node-v8-df5d41bf93a304af4159398d0d9f44f0cba4ac94.zip
doc: add and unify even more return values
PR-URL: https://github.com/nodejs/node/pull/19955 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'doc/api/net.md')
-rw-r--r--doc/api/net.md27
1 files changed, 15 insertions, 12 deletions
diff --git a/doc/api/net.md b/doc/api/net.md
index c3192c84c8..18da052bab 100644
--- a/doc/api/net.md
+++ b/doc/api/net.md
@@ -112,6 +112,8 @@ Emitted when the server has been bound after calling [`server.listen()`][].
added: v0.1.90
-->
+* Returns: {Object}
+
Returns the bound address, the address family name, and port of the server
as reported by the operating system if listening on an IP socket.
Useful to find which port was assigned when getting an OS-assigned address.
@@ -153,8 +155,6 @@ The optional `callback` will be called once the `'close'` event occurs. Unlike
that event, it will be called with an Error as its only argument if the server
was not open when it was closed.
-Returns `server`.
-
### server.connections
<!-- YAML
added: v0.2.0
@@ -500,6 +500,8 @@ See also: [`socket.setTimeout()`][]
added: v0.1.90
-->
+* Returns: {Object}
+
Returns the bound address, the address family name and port of the
socket as reported by the operating system. Returns an object with
three properties, e.g.
@@ -601,8 +603,6 @@ For [IPC][] connections, available `options` are:
See [Identifying paths for IPC connections][]. If provided, the TCP-specific
options above are ignored.
-Returns `socket`.
-
#### socket.connect(path[, connectListener])
* `path` {string} Path the client should connect to. See
@@ -617,8 +617,6 @@ Alias to
[`socket.connect(options[, connectListener])`][`socket.connect(options)`]
called with `{ path: path }` as `options`.
-Returns `socket`.
-
#### socket.connect(port[, host][, connectListener])
<!-- YAML
added: v0.1.90
@@ -636,8 +634,6 @@ Alias to
[`socket.connect(options[, connectListener])`][`socket.connect(options)`]
called with `{port: port, host: host}` as `options`.
-Returns `socket`.
-
### socket.connecting
<!-- YAML
added: v6.1.0
@@ -829,6 +825,8 @@ active socket in the event system. If the socket is already `unref`d calling
added: v0.1.90
-->
+* Returns: {boolean}
+
Sends data on the socket. The second parameter specifies the encoding in the
case of a string — it defaults to UTF8 encoding.
@@ -1068,24 +1066,29 @@ $ nc -U /tmp/echo.sock
added: v0.3.0
-->
-Tests if input is an IP address. Returns 0 for invalid strings,
-returns 4 for IP version 4 addresses, and returns 6 for IP version 6 addresses.
+* Returns: {integer}
+Tests if input is an IP address. Returns `0` for invalid strings,
+returns `4` for IP version 4 addresses, and returns `6` for IP version 6
+addresses.
## net.isIPv4(input)
<!-- YAML
added: v0.3.0
-->
-Returns true if input is a version 4 IP address, otherwise returns false.
+* Returns: {boolean}
+Returns `true` if input is a version 4 IP address, otherwise returns `false`.
## net.isIPv6(input)
<!-- YAML
added: v0.3.0
-->
-Returns true if input is a version 6 IP address, otherwise returns false.
+* Returns: {boolean}
+
+Returns `true` if input is a version 6 IP address, otherwise returns `false`.
[`'close'`]: #net_event_close
[`'connect'`]: #net_event_connect