Skip to content

Commit

Permalink
doc: add warning for socket.connect reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed May 5, 2020
1 parent 3293954 commit 11ae8f4
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 not be used for reconnecting a socket. Calling
[`socket.connect()`][] a second time leads to undefined behavior.
[`net.connect()`][] implicitly calls [`socket.connect()`][].

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

0 comments on commit 11ae8f4

Please sign in to comment.