X-Git-Url: https://git.llucax.com/software/eventxx.git/blobdiff_plain/a1caadbfd2783e837f151c2ede0e4bafec236fe5..db9ba86023886d6ba4344921e8a2e4de731e839d:/README diff --git a/README b/README index 59c2017..dbc5a6a 100644 --- a/README +++ b/README @@ -30,8 +30,8 @@ href="http://www.llucax.com.ar/~luca/eventxx/releases/eventxx.tar.gz">current release from the release directory or grab the -most up to date -sources from the git repository. +most up +to date sources from the git repository. You can also take a look the the eventxx @@ -92,6 +92,7 @@ struct handler handler(eventxx::dispatcher& d): d(d), i(0) {} void operator() (int signum, eventxx::type event) { + std::cout << ++i << " interrupts, "; if (i < 5) std::cout << "keep going...\n"; else { @@ -101,19 +102,18 @@ struct handler } }; -void sighandler(int signum, short event, void* data) +void timer_handler(int, short, void*) { - int& i = *static_cast< int* >(data); - std::cout << ++i << " interrupts, "; + std::cout << "Press Ctrl-C 5 times to quit.\n"; } int main() { eventxx::dispatcher d; handler h(d); - eventxx::csignal sigev(SIGINT, sighandler, &h.i); + eventxx::ctimer t(timer_handler); eventxx::signal< handler > e(SIGINT, h); - d.add(sigev); + d.add(t, eventxx::time(1)); // 1 second d.add(e); d.dispatch(); return 0; @@ -126,8 +126,7 @@ examples related page. @section Status -This library has not been widely used yet, but it's used in some serious -projects, so I think it's moderately stable now. The library has no support +I think the library is moderately stable now. The library has no support for buffered events yet, but patches are welcome. It doesn't support the HTTP stuff, and probably never will because that has nothing to do with event handling. @@ -137,9 +136,9 @@ had a way free that memory, from version 1.2 to 1.3a, if you tried to free the memory the program @c abort() because a failed assertion). Because of that, there is a way to disable the @link eventxx::dispatcher::~dispatcher() dispatcher destructor @endlink (which calls the inexistent/broken -@c event_base_free() function). So if you use a @libevent version previous -to 1.3b, you have to compile your programs defining the -@c EVENTXX_NO_EVENT_BASE_FREE macro. +@c event_base_free() function in the broken versions). So if you use a +@libevent version previous to 1.3b, you have to compile your programs +defining the @c EVENTXX_NO_EVENT_BASE_FREE macro. If something is broken it would be really easy to fix because @eventxx is just a simple wrapper around @libevent. So, please try it out, and if you @@ -158,7 +157,7 @@ it. @par License This program is under the BOLA license (see http://auriga.wearlab.de/~alb/bola/ for more details or read the -LICENSE +LICENSE file itself, it's very short and it basically says it's Public Domain). */