@@ -245,20 +245,23 @@ chained.
245245<!-- YAML
246246added: v0.1.99
247247changes:
248+ - version: REPLACEME
249+ pr-url: https://github.com/nodejs/node/pull/11985
250+ description: The `msg` parameter can be an Uint8Array now.
251+ - version: REPLACEME
252+ pr-url: https://github.com/nodejs/node/pull/10473
253+ description: The `address` parameter is always optional now.
248254 - version: v6.0.0
249255 pr-url: https://github.com/nodejs/node/pull/5929
250256 description: On success, `callback` will now be called with an `error`
251257 argument of `null` rather than `0`.
252- - version: REPLACEME
253- pr-url: https://github.com/nodejs/node/pull/10473
254- description: The `address` parameter is always optional now.
255258 - version: v5.7.0
256259 pr-url: https://github.com/nodejs/node/pull/4374
257260 description: The `msg` parameter can be an array now. Also, the `offset`
258261 and `length` parameters are optional now.
259262-->
260263
261- * ` msg ` {Buffer|string|array} Message to be sent
264+ * ` msg ` {Buffer|Uint8Array| string|array} Message to be sent
262265* ` offset ` {number} Integer. Optional. Offset in the buffer where the message starts.
263266* ` length ` {number} Integer. Optional. Number of bytes in the message.
264267* ` port ` {number} Integer. Destination port.
@@ -269,7 +272,8 @@ Broadcasts a datagram on the socket. The destination `port` and `address` must
269272be specified.
270273
271274The ` msg ` argument contains the message to be sent.
272- Depending on its type, different behavior can apply. If ` msg ` is a ` Buffer ` ,
275+ Depending on its type, different behavior can apply. If ` msg ` is a ` Buffer `
276+ or ` Uint8Array ` ,
273277the ` offset ` and ` length ` specify the offset within the ` Buffer ` where the
274278message begins and the number of bytes in the message, respectively.
275279If ` msg ` is a ` String ` , then it is automatically converted to a ` Buffer `
@@ -299,7 +303,7 @@ the error is emitted as an `'error'` event on the `socket` object.
299303
300304Offset and length are optional, but if you specify one you would need to
301305specify the other. Also, they are supported only when the first
302- argument is a ` Buffer ` .
306+ argument is a ` Buffer ` or ` Uint8Array ` .
303307
304308Example of sending a UDP packet to a random port on ` localhost ` ;
305309
0 commit comments