libiio - continuous streaming

I am trying to stream data from Ad7768 to Windows PC. Prototype hardware is based on CN054 & De10 board. libiio.dll is linked to C++ Windows code. I replicated behavior of "capture_process" function from iio_oscilloscope  which is invoked by timer and calls io_buffer_refill. My sample rates are very low <40 kSPS.

I don't fully understand how io_buffer_refill works and what happens on server side and documentation I found was not all that great and clear. What happens to the samples if there is a long delay between calls to io_buffer_refill?  What about the other way around (if io_buffer_refill is called 2nd time before ADC had time to acquire enough samples)? Would it return some of the same data which was already returned previously?

How can I check that 2 consequitive calls to io_buffer_refill fetch consequitive uninterrupted sampels, and not discontinues or overlapping chunks?