data may be
a string, a Luau buffer, or an array of byte numbers.
A table form is also accepted for compatibility with older scripts:
raknet.send({ Data = ..., Priority = ..., Reliability = ..., OrderingChannel = ..., Broadcast = ..., ForceReceiptNumber = ..., SystemIdentifier = ... }).
Parameters
string | buffer | table
required
The payload: a string, a buffer, an array of byte numbers, or a legacy options
table containing a
Data field.number
default:"2"
Send priority,
0 through 3. Ignored when the table form is used, which
takes Priority instead and defaults it to 0.number
default:"3"
Reliability mode,
0 through 7. The table form takes Reliability and
defaults it to 0.number
default:"0"
Ordering channel,
0 through 31. The table form takes OrderingChannel.Returns
boolean
true when the packet was accepted for sending.Behavior
- The payload must be non-empty.
- The two forms have different defaults. Positional arguments default to
priority
2and reliability3; the legacy table form defaults both to0. Pass them explicitly if it matters. - Sending is queued, not immediate. The packet is handed to the transport and may be sent on the engine’s thread, which is why the return value means “accepted” rather than “delivered”.
Example
Errors
Related
add_send_hook: change packets the game sends instead.