net.createConnection(path[, connectListener])
path
<string> Socket 应该被连接到的路径。将会被传入到socket.connect(path[, connectListener])
。查看识别 IPC 连接的路径。connectListener
<Function>net.createConnection()
方法的通用参数,在初始化的 socket 上的'connect'
事件的单次监听器。将会被传入到socket.connect(path[, connectListener])
。- 返回: <net.Socket> 新创建的 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.