ENetCompressor

An ENet packet compressor for compressing UDP packets before socket sends or receives.

Members

Variables

compress
size_t function(void* context, const ENetBuffer* inBuffers, size_t inBufferCount, size_t inLimit, enet_uint8* outData, size_t outLimit) compress;

Compresses from inBuffers[0:inBufferCount-1], containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure.

context
void* context;

Context data for the compressor. Must be non-NULL.

decompress
size_t function(void* context, const enet_uint8* inData, size_t inLimit, enet_uint8* outData, size_t outLimit) decompress;

Decompresses from inData, containing inLimit bytes, to outData, outputting at most outLimit bytes. Should return 0 on failure.

destroy
void function(void* context) destroy;

Destroys the context when compression is disabled or the host is destroyed. May be NULL.

Meta