| synopsis || arguments || prev |

kdu_serve::release_chunks

void release_chunks( kds_chunk * chunks, bool check_abandoned=false)

[Declared in "../apps/kdu_server/kdu_serve.h"]

Go to class description.


Synopsis

Recycles the resources returned by generate_increments. The check_abandoned argument is provided for the benefit of advanced server applications which may decide to abandon some of the data chunks which have not yet been transmitted to a remote client. Abandonment means that the application will not transmit these chunks or that it has transmitted them, but is not certain whether or not they have been or ever will be received correctly, and is not prepared to wait to find out. The decision to abandon data chunks may be made in response to a substantial change in the remote user's window of interest, but this decision is the responsibility of the server application, not the present object.

If a chunk has been abandoned (and check_abandoned is true), the function restores its cache model associated with all data-bins which contributed to the abandoned chunk, so as to reflect the state which they had prior to the point at which the generate_increments function was called (unless they have already been restored to an even more primitive state as a result of discovering other abandoned chunks). This process may leave the cache model in a state where the number of cached bytes for some precinct does not correspond to a whole number of packets. This is possible because packets which are larger than the maximum chunk size must be broken down into smaller messages, only some of which may belong to abandoned chunks.

In the event that a fatal error occurs, successful cleanup of all resources does not necessitate that outstanding buffers be released using this function. The internal chunk server keeps track of all resources which it has allocated and destroys them automatically when kdu_serve is destroyed. Note, however, that this means you should clean up any objects which may access kds_chunk objects before destroying the kdu_serve object.


Arguments

chunks [kds_chunk *]

check_abandoned [bool]


| top || synopsis || arguments || prev |