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: fix minor style issues in net.md and http.md #7528

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions doc/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,8 @@ already been bound to a port or domain socket.

Listening on a file descriptor is not supported on Windows.

This function is asynchronous. The last parameter `callback` will be added as
a listener for the `'listening'` event. See also [`net.Server.listen()`][].
This function is asynchronous. `callback` will be added as a listener for the
`'listening'` event. See also [`net.Server.listen()`][].

Returns `server`.

Expand All @@ -688,8 +688,8 @@ added: v0.1.90

Start a UNIX socket server listening for connections on the given `path`.

This function is asynchronous. The last parameter `callback` will be added as
a listener for the `'listening'` event. See also [`net.Server.listen(path)`][].
This function is asynchronous. `callback` will be added as a listener for the
`'listening'` event. See also [`net.Server.listen(path)`][].

### server.listen(port[, hostname][, backlog][, callback])
<!-- YAML
Expand All @@ -708,8 +708,8 @@ The actual length will be determined by your OS through sysctl settings such as
`tcp_max_syn_backlog` and `somaxconn` on linux. The default value of this
parameter is 511 (not 512).

This function is asynchronous. The last parameter `callback` will be added as
a listener for the `'listening'` event. See also [`net.Server.listen(port)`][].
This function is asynchronous. `callback` will be added as a listener for the
`'listening'` event. See also [`net.Server.listen(port)`][].

### server.listening
<!-- YAML
Expand Down Expand Up @@ -1004,8 +1004,8 @@ be called multiple times to provide successive parts of the body.

`chunk` can be a string or a buffer. If `chunk` is a string,
the second parameter specifies how to encode it into a byte stream.
By default the `encoding` is `'utf8'`. The last parameter `callback`
will be called when this chunk of data is flushed.
By default the `encoding` is `'utf8'`. `callback` will be called when this chunk
of data is flushed.

**Note**: This is the raw HTTP body and has nothing to do with
higher-level multi-part body encodings that may be used.
Expand Down Expand Up @@ -1290,7 +1290,7 @@ $ node
}
```

If you would like to extract the params from the query string,
If you would like to extract the parameters from the query string,
you can use the `require('querystring').parse` function, or pass
`true` as the second argument to `require('url').parse`. Example:

Expand Down
24 changes: 13 additions & 11 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ Listening on a file descriptor is not supported on Windows.

This function is asynchronous. When the server has been bound,
[`'listening'`][] event will be emitted.
The last parameter `callback` will be added as a listener for the
[`'listening'`][] event.

The parameter `backlog` behaves the same as in
`backlog` behaves the same as in
[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`].

`callback` will be added as a listener for the [`'listening'`][] event.

### server.listen(options[, callback])
<!-- YAML
added: v0.11.14
Expand Down Expand Up @@ -186,8 +186,12 @@ added: v0.1.90
Start a local socket server listening for connections on the given `path`.

This function is asynchronous. When the server has been bound,
[`'listening'`][] event will be emitted. The last parameter `callback`
will be added as a listener for the [`'listening'`][] event.
[`'listening'`][] event will be emitted.

`backlog` behaves the same as in
[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`].

`callback` will be added as a listener for the [`'listening'`][] event.

On UNIX, the local domain is usually known as the UNIX domain. The path is a
filesystem path name. It gets truncated to `sizeof(sockaddr_un.sun_path)`
Expand All @@ -208,9 +212,6 @@ double-backslashes, such as:
net.createServer().listen(
path.join('\\\\?\\pipe', process.cwd(), 'myctl'))

The parameter `backlog` behaves the same as in
[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`].

### server.listen(port[, hostname][, backlog][, callback])
<!-- YAML
added: v0.1.90
Expand All @@ -221,14 +222,15 @@ Begin accepting connections on the specified `port` and `hostname`. If the
(`::`) when IPv6 is available, or any IPv4 address (`0.0.0.0`) otherwise. Use a
port value of `0` to have the operating system assign an available port.

Backlog is the maximum length of the queue of pending connections.
`backlog` is the maximum length of the queue of pending connections.
The actual length will be determined by the OS through sysctl settings such as
`tcp_max_syn_backlog` and `somaxconn` on Linux. The default value of this
parameter is 511 (not 512).

This function is asynchronous. When the server has been bound,
[`'listening'`][] event will be emitted. The last parameter `callback`
will be added as a listener for the [`'listening'`][] event.
[`'listening'`][] event will be emitted.

`callback` will be added as a listener for the [`'listening'`][] event.

One issue some users run into is getting `EADDRINUSE` errors. This means that
another server is already running on the requested port. One way of handling this
Expand Down