#include <callbacks.h>
Inheritance diagram for fpoller::read_callback::
Public Methods | |
read_callback (size_t block_size=4096) | |
ret_val | operator() (int fd) |
All read_callbacks need to have a parser defined , for which there is no default. The parser must have a default constructor and define a function parse with the following declaration:
void parse (int fd, svec &incoming, int request_size);
This function should do any processing necessary, and probably, add a write callback to the poller, to provide a response. ReadingPolicy determines how file descriptor is read (as socket, as disk file, etc). ErrorHandler Policy, in a surprise, determines how errors are handled. ReadCompletionPolicy specifies how to determine when a read is complete (eof reached, magic string found, etc). Poller specifies type of poller that will be calling operator(). The default, poller, is almost always correct. File Descriptor is always closed in case of error.
Definition at line 201 of file callbacks.h.
|
Descendant classes must implement. The parameter is the descriptor for which the callback is being called. Reimplemented from fpoller::callback. Definition at line 209 of file callbacks.h. |