From c92685b150adf2a6adf3bc3735e2ef45acf6a27a Mon Sep 17 00:00:00 2001 From: "Gurin, Sebastian" Date: Thu, 12 Apr 2018 03:15:56 -0300 Subject: [PATCH 1/5] net socket write signature docs --- doc/api/net.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/net.md b/doc/api/net.md index 18da052bab8c95..06bbee78aeff80 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -825,6 +825,10 @@ active socket in the event system. If the socket is already `unref`d calling added: v0.1.90 --> + +* `data` {string|Buffer} +* `encoding` {string} **Default:** `UTF8` +* `callback` {Function} * Returns: {boolean} Sends data on the socket. The second parameter specifies the encoding in the From 277c8aee08f20644d2a985ce78054985d068d094 Mon Sep 17 00:00:00 2001 From: "Gurin, Sebastian" Date: Thu, 12 Apr 2018 04:06:30 -0300 Subject: [PATCH 2/5] add reference to stream writable _write() --- doc/api/net.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/api/net.md b/doc/api/net.md index 06bbee78aeff80..9140efae451f73 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -825,7 +825,6 @@ active socket in the event system. If the socket is already `unref`d calling added: v0.1.90 --> - * `data` {string|Buffer} * `encoding` {string} **Default:** `UTF8` * `callback` {Function} @@ -841,6 +840,8 @@ buffer. Returns `false` if all or part of the data was queued in user memory. The optional `callback` parameter will be executed when the data is finally written out - this may not be immediately. +See Writable stream [`_write()`][stream_writable_write] method for more information. + ## net.connect() Aliases to @@ -1146,3 +1147,4 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [socket(7)]: http://man7.org/linux/man-pages/man7/socket.7.html [unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0 [unspecified IPv6 address]: https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address +[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback_1 From 94de46990ec4e348aeb8d2eac5d0d98f20cf6b82 Mon Sep 17 00:00:00 2001 From: "Gurin, Sebastian" Date: Thu, 12 Apr 2018 04:29:35 -0300 Subject: [PATCH 3/5] stream write docs: reference write(), add Uint8Array input type --- doc/api/net.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index 9140efae451f73..0b3d5fa7e7d5ab 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -825,7 +825,7 @@ active socket in the event system. If the socket is already `unref`d calling added: v0.1.90 --> -* `data` {string|Buffer} +* `data` {string|Buffer|Uint8Array} * `encoding` {string} **Default:** `UTF8` * `callback` {Function} * Returns: {boolean} @@ -840,7 +840,7 @@ buffer. Returns `false` if all or part of the data was queued in user memory. The optional `callback` parameter will be executed when the data is finally written out - this may not be immediately. -See Writable stream [`_write()`][stream_writable_write] method for more information. +See Writable stream [`write()`][stream_writable_write] method for more information. ## net.connect() @@ -1147,4 +1147,4 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [socket(7)]: http://man7.org/linux/man-pages/man7/socket.7.html [unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0 [unspecified IPv6 address]: https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address -[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback_1 +[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback From 1a48c06e3e0caf61ac290b7a4123873255e282e8 Mon Sep 17 00:00:00 2001 From: "Gurin, Sebastian" Date: Thu, 12 Apr 2018 08:27:40 -0300 Subject: [PATCH 4/5] docs socket write encoding param comment --- doc/api/net.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index 0b3d5fa7e7d5ab..f38b6f267a3deb 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -826,7 +826,7 @@ added: v0.1.90 --> * `data` {string|Buffer|Uint8Array} -* `encoding` {string} **Default:** `UTF8` +* `encoding` {string} **Default:** `utf8`. Only used when data is `string` * `callback` {Function} * Returns: {boolean} @@ -1145,6 +1145,6 @@ Returns `true` if input is a version 6 IP address, otherwise returns `false`. [duplex stream]: stream.html#stream_class_stream_duplex [half-closed]: https://tools.ietf.org/html/rfc1122 [socket(7)]: http://man7.org/linux/man-pages/man7/socket.7.html +[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback [unspecified IPv4 address]: https://en.wikipedia.org/wiki/0.0.0.0 [unspecified IPv6 address]: https://en.wikipedia.org/wiki/IPv6_address#Unspecified_address -[stream_writable_write]: stream.html#stream_writable_write_chunk_encoding_callback From f3dd57c0e436e060838077d0934975f1e663582a Mon Sep 17 00:00:00 2001 From: "Gurin, Sebastian" Date: Thu, 12 Apr 2018 15:58:03 -0300 Subject: [PATCH 5/5] doc socket write fix --- doc/api/net.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/net.md b/doc/api/net.md index f38b6f267a3deb..3556e6df17ecfc 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -826,7 +826,7 @@ added: v0.1.90 --> * `data` {string|Buffer|Uint8Array} -* `encoding` {string} **Default:** `utf8`. Only used when data is `string` +* `encoding` {string} Only used when data is `string`. **Default:** `utf8`. * `callback` {Function} * Returns: {boolean} @@ -840,7 +840,8 @@ buffer. Returns `false` if all or part of the data was queued in user memory. The optional `callback` parameter will be executed when the data is finally written out - this may not be immediately. -See Writable stream [`write()`][stream_writable_write] method for more information. +See Writable stream [`write()`][stream_writable_write] method for more +information. ## net.connect()