From 03ba7182d3e525203cd8535ce154a94242a6f511 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 1 Oct 2008 04:25:25 +0000 Subject: *** empty log message *** --- ev.pod | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'ev.pod') diff --git a/ev.pod b/ev.pod index a3b3467..f6b466f 100644 --- a/ev.pod +++ b/ev.pod @@ -2515,20 +2515,23 @@ the given C and C set will be created and started. If C is less than 0, then no timeout watcher will be started. Otherwise an C watcher with after = C (and -repeat = 0) will be started. While C<0> is a valid timeout, it is of -dubious value. +repeat = 0) will be started. C<0> is a valid timeout. The callback has the type C and gets passed an C set like normal event callbacks (a combination of C, C, C or C) and the C -value passed to C: +value passed to C. Note that it is possible to receive I +a timeout and an io event at the same time - you probably should give io +events precedence. + +Example: wait up to ten seconds for data to appear on STDIN_FILENO. static void stdin_ready (int revents, void *arg) { - if (revents & EV_TIMEOUT) - /* doh, nothing entered */; - else if (revents & EV_READ) + if (revents & EV_READ) /* stdin might have data for us, joy! */; + else if (revents & EV_TIMEOUT) + /* doh, nothing entered */; } ev_once (STDIN_FILENO, EV_READ, 10., stdin_ready, 0); -- cgit v1.2.3