Network internalsOverview
raknet.add_send_hook
Represents registration of an outgoing-packet callback.
Aliases
add_send_hookraknet.addsendhookDetails#
Registers an outgoing-packet callback and returns the same function for removal. Registering does not send a packet. The example registers an empty observer and immediately removes it without altering traffic.
Examples#
Example
local function observer(packet) end
local callback = raknet.add_send_hook(observer)
print(callback == observer) -- true
raknet.remove_send_hook(callback)