事件:'connectionAttemptFailed'


【Event: 'connectionAttemptFailed'

  • ip <string> 套接字尝试连接的 IP 地址。
  • port <number> 套接字尝试连接的端口。
  • family <number> IP 的类型。可以是 IPv6 的 6 或 IPv4 的 4
  • error <Error> 与失败相关的错误。

当连接尝试失败时发出。如果在 socket.connect(options) 中启用了地址族自动选择算法,可能会多次发出此事件。

【Emitted when a connection attempt failed. This may be emitted multiple times if the family autoselection algorithm is enabled in socket.connect(options).】