6. Packet

class haka.packet.packet

Object representing a packet. The data can be accessed using the standard Lua operators # to get the length and [] to access the bytes.

drop()

Drop the packet.

Note

The packet will be unusable after calling this function.

accept()

Accept the packet.

Note

The packet will be unusable after calling this function.

send()

Send the packet.

resize(size)

Set the packet length to size.

haka.packet.new(size)

Create new packet of size size.

haka.packet.mode()

Returns the packet mode: passthrough mode or normal mode.