Description

Discard the given number of bytes.

This has the same effect as reading and discarding the given amount of bytes, without executing the actual copy.

It's often paired with Efl.Io.Queue.slice, if users read the information from the slice and once they're done, that data must be discarded.

As an example, some protocols provide messages with a "size" header, in which case Efl.Io.Queue.slice is used to peek into the available memory to see if there is a "size" and if the rest of the slice is the full payload. In that situation the slice may be handled by a processing function. When the function is complete the defined amount of data must be discarded -- with this function.

Since 1.19

Signature

discard {
    params {
        @in amount: size;
    }
}

C signature

void efl_io_queue_discard(Eo *obj, size_t amount);

Parameters

  • amount (in) - Bytes to discard

Implemented by

  • Efl.Io.Queue.discard