The libevent API (libevent應用程序)provides a mechanism(機制) to execute(執行) a callback function(回調函數) when a specific(特別的) event occurs on(發生在) a file descriptor(文件描述符) or after a timeout has been reached.(時間超時以後)html
Furthermore(此外), libevent also support callbacks due to(對於) signals(信號) or regular timeouts.(規律性的超時)linux
libevent is meant to (是爲了)replace the event loop (時間循環)found in(分佈在) event driven network servers(事件驅動網絡服務器). An application just needs to call event_dispatch()and then(而後) add or remove events dynamically (動態地)without having to (而不須要)change the event loop.web
Currently, libevent supports /dev/poll, kqueue(2), event ports, POSIX select(2), Windows select(), poll(2), and epoll(4). The internal event mechanism(內部的事件機制) is completely independent of the exposed(暴露的) event API, and a simple update of libevent can provide new functionality(功能) without having to redesign(從新設計) the applications. As a result, Libevent allows for(容許) portable application(綠色軟件) development and provides the most scalable(可擴展的) event notification mechanism available on an operating system. Libevent can also be used for被用於 multi-threaded多線程 applications, either(也) by(經過) isolating(隔離) each event_base(事件庫) so that(以便於) only a single thread accesses(訪問) it, or by locked(鎖定) access to a single shared event_base.Libevent should compile(編譯) on Linux, *BSD, Mac OS X, Solaris, Windows, and more.安全
Libevent additionally(附帶的地;此外) provides a sophisticated(複雜的) framework(框架) for buffered(緩衝的) network IO, with support for sockets(套接口), filters(過濾器), rate-limiting(限速), SSL(安全套接層), zero-copy file transmission(零拷貝文件傳輸), and IOCP輸入輸出應用程序. Libevent includes support for several useful protocols(協議), including DNS, HTTP, and a minimal(最低地) RPC(遠程過程調用) framework(框架).服務器
More information about event notification mechanisms for network servers can be found on(基於) Dan Kegel's "The C10K problem" web page.網絡
A mailing list for libevent (libevent郵件列表)is now available. Libevent is maintained(維持) by Nick Mathewson and Niels Provos.多線程