prot layer

The prot layer, defined in prot.h, is a stdio replacement for network i/o. It does the standard buffering of input and output and allows certain operations especially suited for request/response protocols like IMAP.

Events

The prot layer allows "events" to be associated with each prot stream. These events are trigger at the given time or after when the protstream is attempted to be read from.

An event is currently represented by the following datastructure:

struct prot_waitevent;

typedef struct prot_waitevent *prot_waiteventcallback_t(struct protstream *s,
                            struct prot_waitevent *ev,
                            void *rock);

struct prot_waitevent {
    time_t mark;
    prot_waiteventcallback_t *proc;
    void *rock;
    struct prot_waitevent *next;
};

The application is currently allowed to modify mark, proc, and rock as desired when there are no active calls to a prot function on the stream which this event is associated.

The API is as follows:

Some common things to do with events:


last modified: $Date: 2003/08/06 21:28:05 $