1 #ifndef MSP_IO_EVENTREADER_H_
2 #define MSP_IO_EVENTREADER_H_
10 Helper class for reading data in a way that supports events. For internal use
13 On Windows, overlapped reads are used. Data is read to an internal buffer and
14 handed out from there. An event object is kept synchronized with the buffer
15 state to get level-triggered semantics for poll. Whenever the buffer becomes
16 empty, a new overlapped read is started.
18 Unix-based systems can poll the fd directly, so this class reduces to a simple
19 passthrough to sys_read.
30 EventReader(Handle &, unsigned);
33 const Handle &get_event();
37 unsigned read(char *, unsigned);