These documents are Copyright (c) 2009-2012 by Nick Mathewson, and are made available under the Creative Commons Attribution-Noncommercial-Share Alike license, version 3.0. Future versions may be made available under a less restrictive license.

Additionally, the source code examples in these documents are also licensed under the so-called "3-Clause" or "Modified" BSD license. See the license_bsd file distributed with these documents for the full terms.

For the latest version of this document, see

To get the source for the latest version of this document, install git and run "git clone git://"

About this document

This document will teach you how to use Libevent 2.0 (and later) to write fast portable asynchronous network IO programs in C. We assume:

  • That you already know C.

  • That you already know the basic C networking calls (socket(), connect(), and so on).

A note on examples

The examples in this document should work all right on Linux, FreeBSD, OpenBSD, NetBSD, Mac OS X, Solaris, and Android. Some of the examples may not compile on Windows.