net.createConnection(path[, connectListener])
path<string> 套接字应连接到的路径。 将传给socket.connect(path[, connectListener])。 请参阅标识 IPC 连接的路径。connectListener<Function>net.createConnection()函数的通用参数,对发起套接字上的'connect'事件的单次监听器。 将传给socket.connect(path[, connectListener])。- 返回: <net.Socket> 用于启动连接的新创建的套接字。
发起 IPC 连接。
此函数创建新的 net.Socket,所有选项都设置为默认值,立即启动与 socket.connect(path[, connectListener]) 的连接,然后返回启动连接的 net.Socket。
path<string> Path the socket should connect to. Will be passed tosocket.connect(path[, connectListener]). See Identifying paths for IPC connections.connectListener<Function> Common parameter of thenet.createConnection()functions, an "once" listener for the'connect'event on the initiating socket. Will be passed tosocket.connect(path[, connectListener]).- Returns: <net.Socket> The newly created socket used to start the connection.
Initiates an IPC connection.
This function creates a new net.Socket with all options set to default,
immediately initiates connection with
socket.connect(path[, connectListener]),
then returns the net.Socket that starts the connection.