Skip to content

Commit bf0ed95

Browse files
theanarkhmarco-ippolito
authored andcommitted
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 3d67b6b commit bf0ed95

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.
@@ -1479,7 +1479,8 @@ changes:
14791479
-->
14801480

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

15421544
The optional `callback` is a function that is invoked after the message is
15431545
sent but before the child may have received it. The function is called with a
@@ -1870,6 +1872,7 @@ or [`child_process.fork()`][].
18701872
[`child_process.fork()`]: #child_processforkmodulepath-args-options
18711873
[`child_process.spawn()`]: #child_processspawncommand-args-options
18721874
[`child_process.spawnSync()`]: #child_processspawnsynccommand-args-options
1875+
[`dgram.Socket`]: dgram.md#class-dgramsocket
18731876
[`maxBuffer` and Unicode]: #maxbuffer-and-unicode
18741877
[`net.Server`]: net.md#class-netserver
18751878
[`net.Socket`]: net.md#class-netsocket

0 commit comments

Comments
 (0)