Inherited by buffered_handler, io_event_loop::quit_handler, and tcp_server_handler.
Public Methods | |
void | set_loop (io_event_loop &_loop) |
Attaches the handler to an event loop. More... | |
io_event_loop * | get_loop () |
Returns the event loop to which the handler is attached. More... | |
bool | is_owned () |
Should this handler refrain from deleting itself on connection close? More... | |
void | set_owned (bool o) |
Should this handler refrain from deleting itself on connection close? More... | |
int | get_fd () |
Returns the file descriptor to which the handler is attached. More... | |
Protected Methods | |
io_handler (int fd=-1) | |
Constructor. More... | |
io_handler (io_event_loop &loop, int fd=-1, bool owned=false) | |
Constructor. More... | |
virtual | ~io_handler () |
Destructor. More... | |
void | set_fd (int _fd) |
Attaches the handler to a file descriptor. More... | |
virtual void | ravail () |
Called by the event loop when bytes are available on the file descriptor (if want_read(true) has been called). More... | |
virtual void | wavail () |
Called by the event loop when bytes may be written on the file descriptor (if want_write(true) has been called). More... | |
void | want_read (bool) |
Invoked by the subclass to signal interest in read availability. More... | |
void | want_write (bool) |
Invoked by the subclass to signal interest in write availability. More... | |
Friends | |
class | io_event_loop |
The subclass may call want_read(bool) to enable/disable read events, and want_write(bool) to enable/disable write events.
Handlers are only active when attached to both an event loop (via the constructor or set_loop) and a file descriptor (via the constructor or set_fd).
|
Constructor.
|
|
Constructor.
|
|
Destructor.
|
|
Returns the file descriptor to which the handler is attached.
|
|
Returns the event loop to which the handler is attached.
|
|
Should this handler refrain from deleting itself on connection close?
|
|
Called by the event loop when bytes are available on the file descriptor (if want_read(true) has been called).
Reimplemented in buffered_handler. |
|
Attaches the handler to a file descriptor.
|
|
Attaches the handler to an event loop.
|
|
Should this handler refrain from deleting itself on connection close?
|
|
Invoked by the subclass to signal interest in read availability.
|
|
Invoked by the subclass to signal interest in write availability.
|
|
Called by the event loop when bytes may be written on the file descriptor (if want_write(true) has been called).
Reimplemented in buffered_handler. |
|
|