… | |
… | |
425 | required if you know what you are doing). |
425 | required if you know what you are doing). |
426 | |
426 | |
427 | You have to be careful with dup'ed file descriptors, though. Some backends |
427 | You have to be careful with dup'ed file descriptors, though. Some backends |
428 | (the linux epoll backend is a notable example) cannot handle dup'ed file |
428 | (the linux epoll backend is a notable example) cannot handle dup'ed file |
429 | descriptors correctly if you register interest in two or more fds pointing |
429 | descriptors correctly if you register interest in two or more fds pointing |
430 | to the same file/socket etc. description (that is, they share the same |
430 | to the same underlying file/socket etc. description (that is, they share |
431 | underlying "file open"). |
431 | the same underlying "file open"). |
432 | |
432 | |
433 | If you must do this, then force the use of a known-to-be-good backend |
433 | If you must do this, then force the use of a known-to-be-good backend |
434 | (at the time of this writing, this includes only EVMETHOD_SELECT and |
434 | (at the time of this writing, this includes only EVMETHOD_SELECT and |
435 | EVMETHOD_POLL). |
435 | EVMETHOD_POLL). |
436 | |
436 | |
… | |
… | |
772 | |
772 | |
773 | =back |
773 | =back |
774 | |
774 | |
775 | =head1 LIBEVENT EMULATION |
775 | =head1 LIBEVENT EMULATION |
776 | |
776 | |
|
|
777 | Libev offers a compatibility emulation layer for libevent. It cannot |
|
|
778 | emulate the internals of libevent, so here are some usage hints: |
|
|
779 | |
|
|
780 | =over 4 |
|
|
781 | |
|
|
782 | =item * Use it by including <event.h>, as usual. |
|
|
783 | |
|
|
784 | =item * The following members are fully supported: ev_base, ev_callback, |
|
|
785 | ev_arg, ev_fd, ev_res, ev_events. |
|
|
786 | |
|
|
787 | =item * Avoid using ev_flags and the EVLIST_*-macros, while it is |
|
|
788 | maintained by libev, it does not work exactly the same way as in libevent (consider |
|
|
789 | it a private API). |
|
|
790 | |
|
|
791 | =item * Priorities are not currently supported. Initialising priorities |
|
|
792 | will fail and all watchers will have the same priority, even though there |
|
|
793 | is an ev_pri field. |
|
|
794 | |
|
|
795 | =item * Other members are not supported. |
|
|
796 | |
|
|
797 | =item * The libev emulation is I<not> ABI compatible to libevent, you need |
|
|
798 | to use the libev header file and library. |
|
|
799 | |
|
|
800 | =back |
|
|
801 | |
|
|
802 | =head1 C++ SUPPORT |
|
|
803 | |
777 | TBD. |
804 | TBD. |
778 | |
805 | |
779 | =head1 C++ SUPPORT |
|
|
780 | |
|
|
781 | TBD. |
|
|
782 | |
|
|
783 | =head1 AUTHOR |
806 | =head1 AUTHOR |
784 | |
807 | |
785 | Marc Lehmann <libev@schmorp.de>. |
808 | Marc Lehmann <libev@schmorp.de>. |
786 | |
809 | |