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

Comparing libev/ev.pod (file contents):
Revision 1.67 by root, Fri Dec 7 16:44:12 2007 UTC vs.
Revision 1.68 by root, Fri Dec 7 18:09:43 2007 UTC

883it is best to always use non-blocking I/O: An extra C<read>(2) returning 883it is best to always use non-blocking I/O: An extra C<read>(2) returning
884C<EAGAIN> is far preferable to a program hanging until some data arrives. 884C<EAGAIN> is far preferable to a program hanging until some data arrives.
885 885
886If you cannot run the fd in non-blocking mode (for example you should not 886If you cannot run the fd in non-blocking mode (for example you should not
887play around with an Xlib connection), then you have to seperately re-test 887play around with an Xlib connection), then you have to seperately re-test
888wether a file descriptor is really ready with a known-to-be good interface 888whether a file descriptor is really ready with a known-to-be good interface
889such as poll (fortunately in our Xlib example, Xlib already does this on 889such as poll (fortunately in our Xlib example, Xlib already does this on
890its own, so its quite safe to use). 890its own, so its quite safe to use).
891 891
892=over 4 892=over 4
893 893
1844 1844
1845 1845
1846=head1 MACRO MAGIC 1846=head1 MACRO MAGIC
1847 1847
1848Libev can be compiled with a variety of options, the most fundemantal is 1848Libev can be compiled with a variety of options, the most fundemantal is
1849C<EV_MULTIPLICITY>. This option determines wether (most) functions and 1849C<EV_MULTIPLICITY>. This option determines whether (most) functions and
1850callbacks have an initial C<struct ev_loop *> argument. 1850callbacks have an initial C<struct ev_loop *> argument.
1851 1851
1852To make it easier to write programs that cope with either variant, the 1852To make it easier to write programs that cope with either variant, the
1853following macros are defined: 1853following macros are defined:
1854 1854
1888loop, if multiple loops are supported ("ev loop default"). 1888loop, if multiple loops are supported ("ev loop default").
1889 1889
1890=back 1890=back
1891 1891
1892Example: Declare and initialise a check watcher, utilising the above 1892Example: Declare and initialise a check watcher, utilising the above
1893macros so it will work regardless of wether multiple loops are supported 1893macros so it will work regardless of whether multiple loops are supported
1894or not. 1894or not.
1895 1895
1896 static void 1896 static void
1897 check_cb (EV_P_ ev_timer *w, int revents) 1897 check_cb (EV_P_ ev_timer *w, int revents)
1898 { 1898 {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines