Methods include state transitions, packet parsing, and user request satisfaction. The context also has two buffer managers-one for the send buffer and one for the receive buffer. When a packet arrives, the context manager examines the packet only enough to figure out which context should get the packet. Within the protocol-specific context derived class should be methods for parsing each type of incoming packet, and for responding to the directives contained within that packet. The buffer manager provides both the user and the protocol access to data buffers.
Methods exist for writing to and reading from the buffer.
Since the buffer is where data is kept until it can be released, methods exist for moving the various markers in the buffer. The manager hides the implementation of the data buffer, but treats the structure like a circular buffer that is shared between the user application and the daemon. In general, one of the managers writes to the buffer and the other manager reads from it, so there must be some way of coordinating the head and tail markers for the buffer. The buffers are also used to hold data until the acknowledgement is received. This marker must be given, via a response to a user request command, to the user application's buffer manager so that the buffer space can be freed.