5 using eventxx::dispatcher;
7 #define OSASSERT(func, ...) if (func(__VA_ARGS__) == -1) { perror(#func "()"); exit(1); }
13 handler(dispatcher& d): d(d)
16 OSASSERT(pipe, fds+2);
18 void operator() (int fd, short event)
21 OSASSERT(read, fd, buf, 7);
22 std::cout << "Read from fd " << fd << ": " << buf << "\n";
31 OSASSERT(write, h.fds[1], "hola 1", 7);
32 OSASSERT(write, h.fds[3], "hola 2", 7);
33 eventxx::event< handler > e1(h.fds[0], EV_READ, h);
34 eventxx::event< handler > e2(h.fds[2], EV_READ, h);