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

Comparing libev/ev.pod (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

118 118
119If you don't know what event loop to use, use the one returned from this 119If you don't know what event loop to use, use the one returned from this
120function. 120function.
121 121
122The flags argument can be used to specify special behaviour or specific 122The flags argument can be used to specify special behaviour or specific
123backends to use, and is usually specified as 0 (or EVFLAG_AUTO) 123backends to use, and is usually specified as 0 (or EVFLAG_AUTO).
124 124
125It supports the following flags: 125It supports the following flags:
126 126
127=over 4 127=over 4
128 128
131The default flags value. Use this if you have no clue (its the right 131The default flags value. Use this if you have no clue (its the right
132thing, believe me). 132thing, believe me).
133 133
134=item EVFLAG_NOENV 134=item EVFLAG_NOENV
135 135
136If this flag bit is ored into the flag value then libev will I<not> look 136If this flag bit is ored into the flag value (or the program runs setuid
137at the environment variable C<LIBEV_FLAGS>. Otherwise (the default), this 137or setgid) then libev will I<not> look at the environment variable
138environment variable will override the flags completely. This is useful 138C<LIBEV_FLAGS>. Otherwise (the default), this environment variable will
139override the flags completely if it is found in the environment. This is
139to try out specific backends to tets their performance, or to work around 140useful to try out specific backends to test their performance, or to work
140bugs. 141around bugs.
141 142
142=item EVMETHOD_SELECT portable select backend 143=item EVMETHOD_SELECT portable select backend
143 144
144=item EVMETHOD_POLL poll backend (everywhere except windows) 145=item EVMETHOD_POLL poll backend (everywhere except windows)
145 146
409in each iteration of the event loop (This behaviour is called 410in each iteration of the event loop (This behaviour is called
410level-triggering because you keep receiving events as long as the 411level-triggering because you keep receiving events as long as the
411condition persists. Remember you cna stop the watcher if you don't want to 412condition persists. Remember you cna stop the watcher if you don't want to
412act on the event and neither want to receive future events). 413act on the event and neither want to receive future events).
413 414
415In general you can register as many read and/or write event watchers oer
416fd as you want (as long as you don't confuse yourself). Setting all file
417descriptors to non-blocking mode is also usually a good idea (but not
418required if you know what you are doing).
419
420You have to be careful with dup'ed file descriptors, though. Some backends
421(the linux epoll backend is a notable example) cannot handle dup'ed file
422descriptors correctly if you register interest in two or more fds pointing
423to the same file/socket etc. description.
424
425If you must do this, then force the use of a known-to-be-good backend
426(at the time of this writing, this includes only EVMETHOD_SELECT and
427EVMETHOD_POLL).
428
414=over 4 429=over 4
415 430
416=item ev_io_init (ev_io *, callback, int fd, int events) 431=item ev_io_init (ev_io *, callback, int fd, int events)
417 432
418=item ev_io_set (ev_io *, int fd, int events) 433=item ev_io_set (ev_io *, int fd, int events)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines