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

doc: replace server.close() which don't exist in code snippets in tls.md #23239

Closed
wants to merge 1 commit into from

Conversation

oyyd
Copy link
Contributor

@oyyd oyyd commented Oct 3, 2018

Replace server.close() as the server don't exist in the code snippets in tls.md.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. tls Issues and PRs related to the tls subsystem. labels Oct 3, 2018
doc/api/tls.md Outdated
@@ -944,7 +944,7 @@ socket.on('data', (data) => {
console.log(data);
});
socket.on('end', () => {
server.close();
console.log('client ends')
Copy link
Member

Choose a reason for hiding this comment

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

Linter complains about missing semicolons.

@Trott
Copy link
Member

Trott commented Oct 3, 2018

Not opposed to this change, but I think we can do even better. The comment above the code samples says it implements an "echo server". The client is connecting on port 8000 to localhost but that is not explained. The code samples might be improved by adding the server code (listening on loclahost port 8000) and leaving server.close() in there. Alternatively, update the comment above the code samples to indicate what is actually being implemented there. Might be worth doing some git archaeology to see if the server code used to be there and was removed.

@Trott
Copy link
Member

Trott commented Oct 3, 2018

(I guess since this is documenting connect() and not a server function, maybe leave the server implementation out but add a comment explaining that it assumes a server listening on port 8000 etc.?)

Copy link
Member

@Trott Trott left a comment

Choose a reason for hiding this comment

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

LGTM. I left some comments about other stuff that can be done to improve this particular bit of sample code, and that can certainly happen in this PR, but it can also happen in a subsequent PR or not at all.

@lpinca
Copy link
Member

lpinca commented Oct 3, 2018

I agree, this sentence The following implements a simple "echo server" example: followed by the client example is a bit confusing.

@oyyd
Copy link
Contributor Author

oyyd commented Oct 3, 2018

Thanks for your advice. Let me improve it a bit.

@oyyd
Copy link
Contributor Author

oyyd commented Oct 3, 2018

The following implements a simple "echo server" example:

This sentence seems to be changed by accident in 1b6a468.
I have changed the original sentence a bit as the "echo server" is described in the following.

@lundibundi
Copy link
Member

@vsemozhetbyt vsemozhetbyt added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Oct 3, 2018
@vsemozhetbyt
Copy link
Contributor

Landed in 0544816
Thank you!

vsemozhetbyt pushed a commit that referenced this pull request Oct 5, 2018
Replace `server.close()` which don't exist in code snippets.

PR-URL: #23239
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
targos pushed a commit that referenced this pull request Oct 6, 2018
Replace `server.close()` which don't exist in code snippets.

PR-URL: #23239
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
targos pushed a commit that referenced this pull request Oct 7, 2018
Replace `server.close()` which don't exist in code snippets.

PR-URL: #23239
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
jasnell pushed a commit that referenced this pull request Oct 17, 2018
Replace `server.close()` which don't exist in code snippets.

PR-URL: #23239
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@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. tls Issues and PRs related to the tls subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants