-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Description
In the version of the dgram
doc that is current as of this writing, the first argument (buf
) is described initially as:
Buffer object, string, or an array of either. Message to be sent.
However, it is subsequently described as a Buffer object only:
The
buf
argument is a [Buffer
] object containing the message. Theoffset
andlength
specify the offset within theBuffer
where the message begins
and the number of bytes in the message, respectively. With messages that
contain multi-byte characters,offset
andlength
will be calculated with
respect to [byte length][] and not the character position.
Additionally, it is not clear what offset
and length
mean when the buf
argument is an array. It's also not clear if the multi-byte caveat applies if buf
is a string or only if buf
is a Buffer object.
It may be worth changing the name from buf
to msg
or something like that.
/cc @nodejs/documentation