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

Comparing libev/ev.html (file contents):
Revision 1.7 by root, Mon Nov 12 08:16:02 2007 UTC vs.
Revision 1.8 by root, Mon Nov 12 08:20:02 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:16:01 2007" /> 9 <meta name="created" content="Mon Nov 12 09:20:02 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 -->
157false. If it already was initialised it simply returns it (and ignores the 157false. If it already was initialised it simply returns it (and ignores the
158flags).</p> 158flags).</p>
159 <p>If you don't know what event loop to use, use the one returned from this 159 <p>If you don't know what event loop to use, use the one returned from this
160function.</p> 160function.</p>
161 <p>The flags argument can be used to specify special behaviour or specific 161 <p>The flags argument can be used to specify special behaviour or specific
162backends to use, and is usually specified as 0 (or EVFLAG_AUTO)</p> 162backends to use, and is usually specified as 0 (or EVFLAG_AUTO).</p>
163 <p>It supports the following flags:</p> 163 <p>It supports the following flags:</p>
164 <p> 164 <p>
165 <dl> 165 <dl>
166 <dt>EVFLAG_AUTO</dt> 166 <dt>EVFLAG_AUTO</dt>
167 <dd> 167 <dd>
168 <p>The default flags value. Use this if you have no clue (its the right 168 <p>The default flags value. Use this if you have no clue (its the right
169thing, believe me).</p> 169thing, believe me).</p>
170 </dd> 170 </dd>
171 <dt>EVFLAG_NOENV</dt> 171 <dt>EVFLAG_NOENV</dt>
172 <dd> 172 <dd>
173 <p>If this flag bit is ored into the flag value then libev will <i>not</i> look 173 <p>If this flag bit is ored into the flag value (or the program runs setuid
174at the environment variable <code>LIBEV_FLAGS</code>. Otherwise (the default), this 174or setgid) then libev will <i>not</i> look at the environment variable
175environment variable will override the flags completely. This is useful 175<code>LIBEV_FLAGS</code>. Otherwise (the default), this environment variable will
176override the flags completely if it is found in the environment. This is
176to try out specific backends to tets their performance, or to work around 177useful to try out specific backends to test their performance, or to work
177bugs.</p> 178around bugs.</p>
178 </dd> 179 </dd>
179 <dt>EVMETHOD_SELECT portable select backend</dt> 180 <dt>EVMETHOD_SELECT portable select backend</dt>
180 <dt>EVMETHOD_POLL poll backend (everywhere except windows)</dt> 181 <dt>EVMETHOD_POLL poll backend (everywhere except windows)</dt>
181 <dt>EVMETHOD_EPOLL linux only</dt> 182 <dt>EVMETHOD_EPOLL linux only</dt>
182 <dt>EVMETHOD_KQUEUE some bsds only</dt> 183 <dt>EVMETHOD_KQUEUE some bsds only</dt>
430<p>I/O watchers check whether a file descriptor is readable or writable 431<p>I/O watchers check whether a file descriptor is readable or writable
431in each iteration of the event loop (This behaviour is called 432in each iteration of the event loop (This behaviour is called
432level-triggering because you keep receiving events as long as the 433level-triggering because you keep receiving events as long as the
433condition persists. Remember you cna stop the watcher if you don't want to 434condition persists. Remember you cna stop the watcher if you don't want to
434act on the event and neither want to receive future events).</p> 435act on the event and neither want to receive future events).</p>
436<p>In general you can register as many read and/or write event watchers oer
437fd as you want (as long as you don't confuse yourself). Setting all file
438descriptors to non-blocking mode is also usually a good idea (but not
439required if you know what you are doing).</p>
440<p>You have to be careful with dup'ed file descriptors, though. Some backends
441(the linux epoll backend is a notable example) cannot handle dup'ed file
442descriptors correctly if you register interest in two or more fds pointing
443to the same file/socket etc. description.</p>
444<p>If you must do this, then force the use of a known-to-be-good backend
445(at the time of this writing, this includes only EVMETHOD_SELECT and
446EVMETHOD_POLL).</p>
435<dl> 447<dl>
436 <dt>ev_io_init (ev_io *, callback, int fd, int events)</dt> 448 <dt>ev_io_init (ev_io *, callback, int fd, int events)</dt>
437 <dt>ev_io_set (ev_io *, int fd, int events)</dt> 449 <dt>ev_io_set (ev_io *, int fd, int events)</dt>
438 <dd> 450 <dd>
439 <p>Configures an ev_io watcher. The fd is the file descriptor to rceeive 451 <p>Configures an ev_io watcher. The fd is the file descriptor to rceeive

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines