Skip to content

Commit 312ebd9

Browse files
authored
doc: edit ChildProcess 'message' event docs
- Clarify which types of objects can be sent through `process.send`. - Clarify that IPC handles are not supported on win32 platform. PR-URL: #52154 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent f1635f4 commit 312ebd9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

doc/api/child_process.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -1222,8 +1222,8 @@ added: v0.5.9
12221222
-->
12231223

12241224
* `message` {Object} A parsed JSON object or primitive value.
1225-
* `sendHandle` {Handle} A [`net.Socket`][] or [`net.Server`][] object, or
1226-
undefined.
1225+
* `sendHandle` {Handle|undefined} `undefined` or a [`net.Socket`][],
1226+
[`net.Server`][], or [`dgram.Socket`][] object.
12271227

12281228
The `'message'` event is triggered when a child process uses
12291229
[`process.send()`][] to send messages.
@@ -1481,7 +1481,8 @@ changes:
14811481
-->
14821482

14831483
* `message` {Object}
1484-
* `sendHandle` {Handle}
1484+
* `sendHandle` {Handle|undefined} `undefined`, or a [`net.Socket`][],
1485+
[`net.Server`][], or [`dgram.Socket`][] object.
14851486
* `options` {Object} The `options` argument, if present, is an object used to
14861487
parameterize the sending of certain types of handles. `options` supports
14871488
the following properties:
@@ -1539,7 +1540,8 @@ The optional `sendHandle` argument that may be passed to `subprocess.send()` is
15391540
for passing a TCP server or socket object to the child process. The child will
15401541
receive the object as the second argument passed to the callback function
15411542
registered on the [`'message'`][] event. Any data that is received
1542-
and buffered in the socket will not be sent to the child.
1543+
and buffered in the socket will not be sent to the child. Sending IPC sockets is
1544+
not supported on Windows.
15431545

15441546
The optional `callback` is a function that is invoked after the message is
15451547
sent but before the child may have received it. The function is called with a
@@ -1872,6 +1874,7 @@ or [`child_process.fork()`][].
18721874
[`child_process.fork()`]: #child_processforkmodulepath-args-options
18731875
[`child_process.spawn()`]: #child_processspawncommand-args-options
18741876
[`child_process.spawnSync()`]: #child_processspawnsynccommand-args-options
1877+
[`dgram.Socket`]: dgram.md#class-dgramsocket
18751878
[`maxBuffer` and Unicode]: #maxbuffer-and-unicode
18761879
[`net.Server`]: net.md#class-netserver
18771880
[`net.Socket`]: net.md#class-netsocket

0 commit comments

Comments
 (0)