-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
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
bufargument is a [Buffer] object containing the message. Theoffset
andlengthspecify the offset within theBufferwhere the message begins
and the number of bytes in the message, respectively. With messages that
contain multi-byte characters,offsetandlengthwill 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