Skip to content

Commit 11ae8f4

Browse files
committed
doc: add warning for socket.connect reuse
1 parent 3293954 commit 11ae8f4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/net.md

Lines changed: 4 additions & 0 deletions
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 not be used for reconnecting a socket. Calling
604+
[`socket.connect()`][] a second time leads to undefined behavior.
605+
[`net.connect()`][] implicitly calls [`socket.connect()`][].
606+
603607
#### `socket.connect(options[, connectListener])`
604608
<!-- YAML
605609
added: v0.1.90

0 commit comments

Comments
 (0)