Skip to content

Commit 0cbee57

Browse files
ronagcodebytere
authored andcommitted
doc: add warning for socket.connect reuse
PR-URL: #33204 Refs: #25969 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 6a26eee commit 0cbee57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/net.md

+4
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,10 @@ the error passed to the [`'error'`][] listener.
600600
The last parameter `connectListener`, if supplied, will be added as a listener
601601
for the [`'connect'`][] event **once**.
602602

603+
This function should only be used for reconnecting a socket after
604+
`'close'` has been emitted or otherwise it may lead to undefined
605+
behavior.
606+
603607
#### `socket.connect(options[, connectListener])`
604608
<!-- YAML
605609
added: v0.1.90

0 commit comments

Comments
 (0)