libevent - an event notification library
  
 
The libevent API provides a mechanism to execute a callback function when a specific event occurs on a file descriptor or after a timeout has been reached. Furthermore, libevent also support callbacks due to signals or regular timeouts.

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.

Currently, libevent supports /dev/poll, kqueue(2), event ports, select(2), 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; see Steven Grimm's explanation. Libevent should compile on Linux, *BSD, Mac OS X, Solaris and Windows.

More information about event notification mechanisms for network servers can be found on Dan Kegel's "The C10K problem" web page. Another library that abstracts asynchronous event notification is liboop.

A mailing list for libevent is now available. Libevent is maintained by Nick Mathewson and Niels Provos.

 
 Happpy Hacking 
 Keep me happy while
 hacking on libevent. 
 Reduce my wishlist! 

 Support Libevent 
Search:
Keywords:
 Search Amazon  

Documentation and Support

Documentation: 1.4.10-stable 2.0.1-alpha
Sample Application: event-test.c.
Bug Tracking: Bugs Features
Mailing List: Info Blog

Download

  • libevent-1.4.12-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-07-24
  • libevent-2.0.2-alpha.tar.gz [GPG Sig] - ChangeLog - Release 2009-07-24
  • libevent-1.4.11-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-05-14
  • libevent-2.0.1-alpha.tar.gz [GPG Sig] - What's new - Release 2009-04-17
  • libevent-1.4.10-stable.tar.gz [GPG Sig] - ChangeLog - Release 2009-04-17
  • libevent-1.4.9-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-12-12
  • libevent-1.4.8-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-09-13
  • libevent-1.4.7-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-08-25
  • libevent-1.4.6-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-07-24
  • libevent-1.4.5-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-06-25
  • libevent-1.4.4-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-05-13
  • libevent-1.4.3-stable.tar.gz [GPG Sig] - ChangeLog - Release 2008-04-07
  • libevent-1.4.2-rc.tar.gz [GPG Sig] - ChangeLog - Release 2008-02-25
    • make Solaris event subsystems more reliable; from W.C.A. Wijngaards
    • event_base_get_method(); from Springande Ulv
    • fix HTTP/1.1 chunk formatting; from "propanbutan"
    • allow 64-bit content lengths; from Scott Lamb
    • and more...
  • libevent-1.4.1-beta.tar.gz [GPG Sig] - ChangeLog - Release 2007-12-21
    • fixed some memory leaks and other misc cleanup; from Christopher Layne, Scott Lamb and Charles Kerr
    • introduced event_reinit to deal with fork()
    • improved efficiency of generated RPC structure
    • performance improvements to Win32 backend
    • and many more...
  • libevent-1.4.0-beta.tar.gz [GPG Sig] - ChangeLog - Release 2007-11-11
    • a new RPC subsytem for writing distributed clients and servers
    • almost everything is documented via Doxygen now
    • many fixes and improvements to evdns and evhttp
    • libevent now builds two additional libraries: libevent_core (containing only the event core) and libevent_extras (contained evdns, evhttp and evrpc)
    • performance improvements due to using a heap instead of red-black trees for timeouts
    • Solaris' event ports are better supported
  • libevent-1.3e.tar.gz [GPG Sig] - ChangeLog - Release 2007-09-24
    • Fix compilation on Solaris; from Magne Mahre
    • Add a "Date" header to HTTP responses when it's missing, as required by HTTP 1.1. Original Patch from Ralph Moritz.
    • Fix a memory leak in which failed HTTP connections whould not free the request object.
    • Fix a memory leak in the DNS server.
    • Handle NULL timeouts correctly on Solaris; from Trond Norbye
    • Recalculate pending events properly when reallocating event array on Solaris; from Trond Norbye
  • libevent-1.3d.tar.gz [GPG Sig] - Release 2007-08-16
    • Bug fixes in the HTTP layer.
  • libevent-1.3c.tar.gz [GPG Sig] - Release 2007-07-30
    • Small bug and portability fixes.
  • libevent-1.3b.tar.gz [GPG Sig] - Release 2007-03-03
    • Fixes when using signals in multi-threaded applications from Scott Lamb.
    • Other small bug fixes.
  • libevent-1.3a.tar.gz- Release 2007-02-17
    • Small bug and performances fixes to evhttp layer.
  • libevent-1.3.tar.gz [GPG Sig] - Release 2007-02-15
    • DNS Server from Adam Langley and Nick Mathewson
    • Chunked transfer encoding for HTTP/1.1 from Dug Song.
    • DNS DDoS fix; bug report from Jon Oberheide.
    • Various small improvements.
  • libevent-1.2a.tar.gz- Release 2006-12-02
    • Made HTTP support more usable
    • Various portability fixes.
  • libevent-1.2.tar.gz [GPG Sig] - Release 2006-10-15
    • Support for non-blocking DNS resolution; from Adam Langley and Nick Mathewson.
    • Support for lightweight HTTP clients and servers.
    • Support for Sun's Event Ports from David Pacheco of Sun.
  • libevent-1.1b.tar.gz [GPG Sig] - Release 2006-08-09
    • Bug fixes - thanks to Nick Mathewson for helping.
  • libevent-1.1a.tar.gz [GPG Sig] - Release 2005-06-12
    • Minor reliability fixes.
  • libevent-1.1.tar.gz [GPG Sig] - Release 2005-05-14
    • Performance improvements from Nick Mathewson.
    • Work around for kqueue bug in Mac OS X 10.4.
  • libevent-1.0e.tar.gz [GPG Sig] - Release 2005-04-26
    • Important fix to bug in poll implementation introduced in 1.0d.
  • libevent-1.0d.tar.gz [GPG Sig] - Release 2005-04-22
    • Several minor bug fixes and building of shared libraries.
  • libevent-1.0c.tar.gz [GPG Sig] - Release 2005-04-03
    • Bug fixes for Windows, Solaris and improved logging interface.
  • libevent-1.0b.tar.gz [GPG Sig] - Release 2005-01-13
    • Bug fixes for backwards compatibility.
  • libevent-1.0a.tar.gz [GPG Sig] - Release 2005-01-03
    • Bug fixes for threaded applications. Thanks to Andrew Danforth.
  • libevent-1.0.tar.gz [GPG Sig] - Release 2004-12-05
    • Support for multi-threaded applications - experimental.
    • Event priorities with priority queues.
    • Don't forget my wishlists :-).
  • libevent-0.1.tar.gz - Release 2000-11-14

Libevent has been released under a 3-clause BSD license. Information on public subversion access.
     

Benchmark

Performance comparison using different event notification mechansims in Libevent. We declare interest in a large number of connections of which most are cold and only a few are active.
spacer   spacer
The benchmark measures how long it takes to serve one active connection and exposes scalability issues of traditional interfaces like select or poll.   The benchmark measures how long it takes to serve one hundred active connections that chain writes to new connections until thousand writes and reads have happened. It exercises the event loop several times.

  

Programs using libevent

The usefulness of libevent API is demonstrated by the following applications:
  • Vomit - Voice Over Misconfigured Internet Telephones
  • Crawl - A Small and Efficient HTTP Crawler
  • Libio - an input/output abstraction library
  • Honeyd - a virtual honeynet daemon - can be used to fight Internet worms.
  • Fragroute - an IDS testing tool
  • Nylon - nested proxy server
  • Disconcert - a Distributed Computing Framework for Loosely-Coupled Workstations.
  • PLB - pure load balancer: a free high-performance load balancer for Unix.
  • Trickle - a lightweight userspace bandwidth shaper.
  • Memcached - a high-performance, distributed memory object caching system.
  • watchcatd - software watchdog designed to take actions not as drastic as the usual solutions, which reset the machine.
  • ScanSSH - a fast SSH server and open proxy scanner.
  • Nttlscan - a network topology scanner for Honeyd.
  • NetChat - a combination of netcat and ppp's chat.
  • Io - a small programming language; uses libevent for network communication.
  • Tor - an anonymous Internet communication system.
  • Systrace - a system call sandbox.
  • SpyBye - detect malware on web pages.
  • GreenSQL - an SQL database firewall.
  • dnsscan - a fast scanner for identifying open recursive dns resolvers
  • Kargo Event - a PHP extension for libevent.
 

Niels Provos
Last modified: Wed Apr 7 23:19:27 EDT 2004
  You can keep me happy while hacking by reducing my Wishlists: Books, Music
spacer

NB: configure magic as always provided by Dug Song, though I am learning.
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.