Callback packet contract

AsString, AsBuffer, and AsArray are properties, not methods. Read them without parentheses. Packet userdata points to a native stack context and is valid only during the synchronous callback. Copy AsString or AsBuffer before storing work for later; never store the packet itself, yield, or pass it to task.spawn. Callback return values are ignored; returning false does not block. Callback errors are caught and written to native debugger output. A callback can call packet:SetData(packet.AsString) to keep an unchanged copied payload. packet:Block() blocks immediately; no return value is needed.

Send enums

Priority: 0 Immediate, 1 High, 2 Medium (default), 3 Low. Reliability: 0 Unreliable, 1 UnreliableSequenced, 2 Reliable, 3 ReliableOrdered (default), 4 ReliableSequenced, 5 UnreliableWithAckReceipt, 6 ReliableWithAckReceipt, 7 ReliableOrderedWithAckReceipt. Ordering channel: 0 through 31, default 0. Payload tables are read as an array. Numbers are converted to lua_Integer before the 0..255 check; pass integer bytes to avoid truncation. raknet.send runs registered callbacks and has no native send-result return.