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: add warning for socket.connect reuse #33204

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions doc/api/deprecations.md
Expand Up @@ -2668,6 +2668,22 @@ Type: Documentation-only

Use [`request.destroy()`][] instead of [`request.abort()`][].

<a id="DEP0XXX"></a>
### DEP0XXX: Use `net.connect()` instead of re-using sockets through
`socket.connect()`
<!-- YAML
changes:
- version:
- REPLACEME
pr-url: https://github.com/nodejs/node/pull/33204
description: Documentation-only deprecation.
-->

Type: Documentation-only

Use [`net.connect()`][] instead of re-using sockets through
[`socket.connect()`][].

[`--pending-deprecation`]: cli.html#cli_pending_deprecation
[`--throw-deprecation`]: cli.html#cli_throw_deprecation
[`Buffer.allocUnsafeSlow(size)`]: buffer.html#buffer_class_method_buffer_allocunsafeslow_size
Expand Down Expand Up @@ -2722,6 +2738,7 @@ Use [`request.destroy()`][] instead of [`request.abort()`][].
[`https.get()`]: https.html#https_https_get_options_callback
[`https.request()`]: https.html#https_https_request_options_callback
[`module.createRequire()`]: modules.html#modules_module_createrequire_filename
[`net.connect()`]: net.html#net_net_connect
[`os.networkInterfaces()`]: os.html#os_os_networkinterfaces
[`os.tmpdir()`]: os.html#os_os_tmpdir
[`process.env`]: process.html#process_process_env
Expand All @@ -2742,6 +2759,7 @@ Use [`request.destroy()`][] instead of [`request.abort()`][].
[`script.createCachedData()`]: vm.html#vm_script_createcacheddata
[`setInterval()`]: timers.html#timers_setinterval_callback_delay_args
[`setTimeout()`]: timers.html#timers_settimeout_callback_delay_args
[`socket.connect()`]: net.html#net_socket_connect
[`timeout.ref()`]: timers.html#timers_timeout_ref
[`timeout.refresh()`]: timers.html#timers_timeout_refresh
[`timeout.unref()`]: timers.html#timers_timeout_unref
Expand Down
5 changes: 5 additions & 0 deletions doc/api/net.md
Expand Up @@ -581,6 +581,11 @@ added: v0.5.3
The amount of bytes sent.

### `socket.connect()`
<!-- YAML
deprecated: REPLACEME
-->

> Stability: 0 - Deprecated: Use [`net.connect()`][] instead.

Initiate a connection on a given socket.

Expand Down