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 relative links in net docs #5358

Closed
wants to merge 1 commit into from
Closed
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
14 changes: 7 additions & 7 deletions doc/api/net.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ The last parameter `callback` will be added as a listener for the
[`'listening'`][] event.

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

### server.listen(options[, callback])

Expand All @@ -121,8 +121,8 @@ The parameter `backlog` behaves the same as in

The `port`, `host`, and `backlog` properties of `options`, as well as the
optional callback function, behave as they do on a call to
[`server.listen(port, \[host\], \[backlog\], \[callback\])`][]. Alternatively,
the `path` option can be used to specify a UNIX socket.
[`server.listen(port[, hostname][, backlog][, callback])`][`server.listen(port, host, backlog, callback)`].
Alternatively, the `path` option can be used to specify a UNIX socket.

If `exclusive` is `false` (default), then cluster workers will use the same
underlying handle, allowing connection handling duties to be shared. When
Expand Down Expand Up @@ -167,7 +167,7 @@ double-backslashes, such as:
path.join('\\\\?\\pipe', process.cwd(), 'myctl'))

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

### server.listen(port[, hostname][, backlog][, callback])

Expand Down Expand Up @@ -392,7 +392,7 @@ The `connectListener` parameter will be added as a listener for the
### socket.connect(path[, connectListener])
### socket.connect(port[, host][, connectListener])

As [`socket.connect(options\[, connectListener\])`][],
As [`socket.connect(options\[, connectListener\])`][`socket.connect(options, connectListener)`],
with options either as either `{port: port, host: host}` or `{path: path}`.

### socket.destroy()
Expand Down Expand Up @@ -723,8 +723,8 @@ Returns true if input is a version 6 IP address, otherwise returns false.
[`pause()`]: #net_socket_pause
[`resume()`]: #net_socket_resume
[`server.getConnections()`]: #net_server_getconnections_callback
[`server.listen(port, \[host\], \[backlog\], \[callback\])`]: #net_server_listen_port_hostname_backlog_callback
[`socket.connect(options\[, connectListener\])`]: #net_socket_connect_options_connectlistener
[`server.listen(port, host, backlog, callback)`]: #net_server_listen_port_hostname_backlog_callback
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't this be simply server.listen?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so, the link signature of these methods include the arguments. How are these generated, by the way?

Copy link
Contributor

Choose a reason for hiding this comment

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

@silverwind You mean, this tag could have been auto-generated with a tool?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think they are generated

Copy link
Contributor

Choose a reason for hiding this comment

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

The <a id>'s which these link to are certainly autogenerated from the doctool:

<h3>
  server.listen(port[, hostname][, backlog][, callback])
  <span>
    <a class="mark" href="#net_server_listen_port_hostname_backlog_callback" id="net_server_listen_port_hostname_backlog_callback">#
    </a>
  </span>
</h3>

They long ids are necessary to link to different method signatures, and there can only be one id per element in HTML, so I think your suggestion is not possible.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, and I just notice that I misread your suggestion completely, please disregard me :)

[`socket.connect(options, connectListener)`]: #net_socket_connect_options_connectlistener
[`socket.connect`]: #net_socket_connect_options_connectlistener
[`socket.setTimeout()`]: #net_socket_settimeout_timeout_callback
[`stream.setEncoding()`]: stream.html#stream_readable_setencoding_encoding
Expand Down