事件:'connectionAttempt'


¥Event: 'connectionAttempt'

  • ip <string> 套接字尝试连接的 IP。

    ¥ip <string> The IP which the socket is attempting to connect to.

  • port <number> 套接字尝试连接的端口。

    ¥port <number> The port which the socket is attempting to connect to.

  • family <number> IP 家族。对于 IPv6 可以是 6,对于 IPv4 可以是 4

    ¥family <number> The family of the IP. It can be 6 for IPv6 or 4 for IPv4.

当开始新的连接尝试时触发。如果在 socket.connect(options) 中启用了系列自动选择算法,则可能会多次触发此消息。

¥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).