Home

Traffic Server Software Developers Kit

VIOs

A VIO, or virtual IO, is a description of an IO operation that's in progress. The VIO data structure is used by vconnection users to determine how much progress has been made on a particular IO operation and to re-enable an IO operation when it stalls due to buffer space issues. VIOs are used by vconnection implementors to determine the buffer for an IO operation, how much work to do on the IO operation, and which continuation to call back when progress on the IO operation is made.

The INKVIO data structure itself is opaque, but it could be defined as follows:

typedef struct {
    INKCont continuation;
    INKVConn vconnection;
    INKIOBufferReader reader;
    INKMutex mutex;
    int nbytes;
    int ndone;
} *INKVIO;

The functions below simply access and modify various parts of the data structure.