diff --git a/doc/api/net.md b/doc/api/net.md index fc260b9f636266..8a66a0a68b4c60 100644 --- a/doc/api/net.md +++ b/doc/api/net.md @@ -691,6 +691,47 @@ added: v0.1.90 Emitted when a socket connection is successfully established. See [`net.createConnection()`][]. +### Event: `'connectionAttempt'` + + + +* `ip` {number} The IP which the socket is attempting to connect to. +* `port` {number} The port which the socket is attempting to connect to. +* `family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4. + +Emitted when a new connection attempt is started. This may be emitted multiple times +if the family autoselection algorithm is enabled in [`socket.connect(options)`][]. + +### Event: `'connectionAttemptFailed'` + + + +* `ip` {number} The IP which the socket attempted to connect to. +* `port` {number} The port which the socket attempted to connect to. +* `family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4. + \* `error` {Error} The error associated with the failure. + +Emitted when a connection attempt failed. This may be emitted multiple times +if the family autoselection algorithm is enabled in [`socket.connect(options)`][]. + +### Event: `'connectionAttemptTimeout'` + + + +* `ip` {number} The IP which the socket attempted to connect to. +* `port` {number} The port which the socket attempted to connect to. +* `family` {number} The family of the IP. It can be `6` for IPv6 or `4` for IPv4. + +Emitted when a connection attempt timed out. This is only emitted (and may be +emitted multiple times) if the family autoselection algorithm is enabled +in [`socket.connect(options)`][]. + ### Event: `'data'`