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

Comparing libev/ev.pod (file contents):
Revision 1.322 by root, Sun Oct 24 17:58:41 2010 UTC vs.
Revision 1.323 by root, Sun Oct 24 18:01:26 2010 UTC

342Example: Restrict libev to the select and poll backends, and do not allow 342Example: Restrict libev to the select and poll backends, and do not allow
343environment settings to be taken into account: 343environment settings to be taken into account:
344 344
345 ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV); 345 ev_default_loop (EVBACKEND_POLL | EVBACKEND_SELECT | EVFLAG_NOENV);
346 346
347Example: Use whatever libev has to offer, but make sure that kqueue is
348used if available (warning, breaks stuff, best use only with your own
349private event loop and only if you know the OS supports your types of
350fds):
351
352 ev_default_loop (ev_recommended_backends () | EVBACKEND_KQUEUE);
353
354=item struct ev_loop *ev_loop_new (unsigned int flags) 347=item struct ev_loop *ev_loop_new (unsigned int flags)
355 348
356This will create and initialise a new event loop object. If the loop 349This will create and initialise a new event loop object. If the loop
357could not be initialised, returns false. 350could not be initialised, returns false.
358 351
589Example: Try to create a event loop that uses epoll and nothing else. 582Example: Try to create a event loop that uses epoll and nothing else.
590 583
591 struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV); 584 struct ev_loop *epoller = ev_loop_new (EVBACKEND_EPOLL | EVFLAG_NOENV);
592 if (!epoller) 585 if (!epoller)
593 fatal ("no epoll found here, maybe it hides under your chair"); 586 fatal ("no epoll found here, maybe it hides under your chair");
587
588Example: Use whatever libev has to offer, but make sure that kqueue is
589used if available.
590
591 struct ev_loop *loop = ev_loop_new (ev_recommended_backends () | EVBACKEND_KQUEUE);
594 592
595=item ev_loop_destroy (loop) 593=item ev_loop_destroy (loop)
596 594
597Destroys an event loop object (frees all memory and kernel state 595Destroys an event loop object (frees all memory and kernel state
598etc.). None of the active event watchers will be stopped in the normal 596etc.). None of the active event watchers will be stopped in the normal

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines