ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.html
(Generate patch)

Comparing libev/ev.html (file contents):
Revision 1.3 by root, Mon Nov 12 08:03:31 2007 UTC vs.
Revision 1.4 by root, Mon Nov 12 08:11:01 2007 UTC

4<head> 4<head>
5 <title>libev</title> 5 <title>libev</title>
6 <meta name="description" content="Pod documentation for libev" /> 6 <meta name="description" content="Pod documentation for libev" />
7 <meta name="inputfile" content="&lt;standard input&gt;" /> 7 <meta name="inputfile" content="&lt;standard input&gt;" />
8 <meta name="outputfile" content="&lt;standard output&gt;" /> 8 <meta name="outputfile" content="&lt;standard output&gt;" />
9 <meta name="created" content="Mon Nov 12 09:03:30 2007" /> 9 <meta name="created" content="Mon Nov 12 09:11:00 2007" />
10 <meta name="generator" content="Pod::Xhtml 1.57" /> 10 <meta name="generator" content="Pod::Xhtml 1.57" />
11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head> 11<link rel="stylesheet" href="http://res.tst.eu/pod.css"/></head>
12<body> 12<body>
13<div class="pod"> 13<div class="pod">
14<!-- INDEX START --> 14<!-- INDEX START -->
55</div> 55</div>
56<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p> 56<h1 id="DESCRIPTION">DESCRIPTION</h1><p><a href="#TOP" class="toplink">Top</a></p>
57<div id="DESCRIPTION_CONTENT"> 57<div id="DESCRIPTION_CONTENT">
58<p>Libev is an event loop: you register interest in certain events (such as a 58<p>Libev is an event loop: you register interest in certain events (such as a
59file descriptor being readable or a timeout occuring), and it will manage 59file descriptor being readable or a timeout occuring), and it will manage
60these event sources and provide your program events.</p> 60these event sources and provide your program with events.</p>
61<p>To do this, it must take more or less complete control over your process 61<p>To do this, it must take more or less complete control over your process
62(or thread) by executing the <i>event loop</i> handler, and will then 62(or thread) by executing the <i>event loop</i> handler, and will then
63communicate events via a callback mechanism.</p> 63communicate events via a callback mechanism.</p>
64<p>You register interest in certain events by registering so-called <i>event 64<p>You register interest in certain events by registering so-called <i>event
65watchers</i>, which are relatively small C structures you initialise with the 65watchers</i>, which are relatively small C structures you initialise with the
316*)</code>), and you can stop watching for events at any time by calling the 316*)</code>), and you can stop watching for events at any time by calling the
317corresponding stop function (<code>ev_&lt;type&gt;_stop (loop, watcher *)</code>.</p> 317corresponding stop function (<code>ev_&lt;type&gt;_stop (loop, watcher *)</code>.</p>
318<p>As long as your watcher is active (has been started but not stopped) you 318<p>As long as your watcher is active (has been started but not stopped) you
319must not touch the values stored in it. Most specifically you must never 319must not touch the values stored in it. Most specifically you must never
320reinitialise it or call its set method.</p> 320reinitialise it or call its set method.</p>
321<p>You cna check wether an event is active by calling the <code>ev_is_active 321<p>You cna check whether an event is active by calling the <code>ev_is_active
322(watcher *)</code> macro. To see wether an event is outstanding (but the 322(watcher *)</code> macro. To see whether an event is outstanding (but the
323callback for it has not been called yet) you cna use the <code>ev_is_pending 323callback for it has not been called yet) you cna use the <code>ev_is_pending
324(watcher *)</code> macro.</p> 324(watcher *)</code> macro.</p>
325<p>Each and every callback receives the event loop pointer as first, the 325<p>Each and every callback receives the event loop pointer as first, the
326registered watcher structure as second, and a bitset of received events as 326registered watcher structure as second, and a bitset of received events as
327third argument.</p> 327third argument.</p>
422information given in the last section.</p> 422information given in the last section.</p>
423 423
424</div> 424</div>
425<h2 id="struct_ev_io_is_my_file_descriptor_r">struct ev_io - is my file descriptor readable or writable</h2> 425<h2 id="struct_ev_io_is_my_file_descriptor_r">struct ev_io - is my file descriptor readable or writable</h2>
426<div id="struct_ev_io_is_my_file_descriptor_r-2"> 426<div id="struct_ev_io_is_my_file_descriptor_r-2">
427<p>I/O watchers check wether a file descriptor is readable or writable 427<p>I/O watchers check whether a file descriptor is readable or writable
428in each iteration of the event loop (This behaviour is called 428in each iteration of the event loop (This behaviour is called
429level-triggering because you keep receiving events as long as the 429level-triggering because you keep receiving events as long as the
430condition persists. Remember you cna stop the watcher if you don't want to 430condition persists. Remember you cna stop the watcher if you don't want to
431act on the event and neither want to receive future events).</p> 431act on the event and neither want to receive future events).</p>
432<dl> 432<dl>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines