socket.connect(port[, host][, connectListener])
port<number> 客户端应连接的端口。host<string> 客户端应连接的主机。connectListener<Function>socket.connect()方法的常用参数。将作为监听器添加到'connect'事件中,仅添加一次。- 返回:<net.Socket> 插座本身。
在给定的套接字上发起 TCP 连接。
🌐 Initiate a TCP connection on the given socket.
别名为 socket.connect(options[, connectListener]),调用时将 {port: port, host: host} 作为 options。
🌐 Alias to
socket.connect(options[, connectListener])
called with {port: port, host: host} as options.