Skip to content

Commit

Permalink
doc: add warning for socket.connect reuse
Browse files Browse the repository at this point in the history
PR-URL: #33204
Refs: #25969
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
ronag committed May 8, 2020
1 parent bcdbd57 commit e50ae7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/api/net.md
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,10 @@ the error passed to the [`'error'`][] listener.
The last parameter `connectListener`, if supplied, will be added as a listener
for the [`'connect'`][] event **once**.

This function should only be used for reconnecting a socket after
`'close'` has been emitted or otherwise it may lead to undefined
behavior.

#### `socket.connect(options[, connectListener])`
<!-- YAML
added: v0.1.90
Expand Down

0 comments on commit e50ae7a

Please sign in to comment.