Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net socket write signature docs #19967

Closed
wants to merge 5 commits into from

Conversation

cancerberoSgx
Copy link

document net.Socket.write method signature - just that. Had a good description but the method signature was not documented. tried make doc without problems. Thanks

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. net Issues and PRs related to the net subsystem. labels Apr 12, 2018
Copy link
Member

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably also link to https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1 – it’s the same function

doc/api/net.md Outdated
@@ -825,6 +825,9 @@ active socket in the event system. If the socket is already `unref`d calling
added: v0.1.90
-->

* `data` {string|Buffer}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uint8Array is also accepted.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added

doc/api/net.md Outdated
@@ -837,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.
Copy link
Member

@lpinca lpinca Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. LGTM with some nits)

doc/api/net.md Outdated
@@ -825,6 +825,9 @@ active socket in the event system. If the socket is already `unref`d calling
added: v0.1.90
-->

* `data` {string|Buffer|Uint8Array}
* `encoding` {string} **Default:** `UTF8`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems this should be `'utf8'`

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also to be strict, we could specify that it is only used when data is a string but maybe it's obvious.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done & done

doc/api/net.md Outdated
@@ -1142,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should go after [socket(7)]:, alphabetically.

@vsemozhetbyt
Copy link
Contributor

@cancerberoSgx It seems your local email is not included in the GitHub email list. Please, check these notes to fix this)

Copy link
Member

@BridgeAR BridgeAR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the comments addressed.

Copy link
Contributor

@vsemozhetbyt vsemozhetbyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With some new nits)

doc/api/net.md Outdated
@@ -825,6 +825,9 @@ active socket in the event system. If the socket is already `unref`d calling
added: v0.1.90
-->

* `data` {string|Buffer|Uint8Array}
* `encoding` {string} **Default:** `utf8`. Only used when data is `string`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to bother again. Our doc parsers expect 'Default' part to be the last one. So this should be:
Only used when data is `string`. **Default:** `'utf8'`.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

doc/api/net.md Outdated
@@ -837,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.
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt Apr 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should be wrapped after 80 characters.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@vsemozhetbyt
Copy link
Contributor

@vsemozhetbyt vsemozhetbyt added fast-track PRs that do not need to wait for 48 hours to land. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. labels Apr 12, 2018
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request Apr 13, 2018
PR-URL: nodejs#19967
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@BridgeAR
Copy link
Member

Landed in 8e30589 🎉

@BridgeAR BridgeAR closed this Apr 13, 2018
@cancerberoSgx
Copy link
Author

thanks everybody, I'm very happy!!, this is my first contribution to this great project - hope not my last one, thanks!

jasnell pushed a commit that referenced this pull request Apr 16, 2018
PR-URL: #19967
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BridgeAR pushed a commit to BridgeAR/node that referenced this pull request May 1, 2018
PR-URL: nodejs#19967
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land. net Issues and PRs related to the net subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants