libevent成分

来源:互联网 发布:粤语拼音教学 知乎 编辑:程序博客网 时间:2024/04/28 03:41
evutil

Generic functionality to abstract out the differences between different platforms' networking implementations.

抽象的不同网络平台的网络接口

event and event_base

This is the heart of Libevent. It provides an abstract API to the various platform-specific, event-based nonblocking IO backends. It can let you know when sockets are ready to read or write, do basic timeout functionality, and detect OS signals.

这个是libevent的核心部分,它提供了各种平台指定的抽象接口,它后端是非阻塞的IO,它给外部提供各种事件信号:读、写、超时,分发系统信号。

bufferevent

These functions provide a more convenient wrapper around Libevent’s event-based core. They let your application request buffered reads and writes, and rather than informing you when sockets are ready to do, they let you know when IO has actually occurred.

这里面的方法是基于event-base提供了一套包装方法,它可以让你方便的请求读或者写,

The bufferevent interface also has multiple backends, so thatit can take advantage of systems that provide faster ways to dononblocking IO, such as the Windows IOCP API.
针对各种系统,提供了更加快速的抽象接口,比如windows 的IOCP
evbuffer

This module implements the buffers underlying bufferevents, and provides functions for efficient and/or convenient access.

这个模块继承于bufferevents,他能提供一些有效的方法调用

evhttp

A simple HTTP client/server implementation.

一个简单的http服务器/客户端实现

evdns

A simple DNS client/server implementation.

一个简单dns服务器/客户端实现

evrpc

A simple RPC implementation.

一个简单的RPC实现

When Libevent is built, by default it installs the following libraries:

libevent_core

All core event and buffer functionality. This library contains all the event_base, evbuffer, bufferevent, and utility functions.

核心和基本库都在这里面

libevent_extra

This library defines protocol-specific functionality that you may or may not want for your application, including HTTP, DNS, and RPC.

提供一些扩展协议函数

libevent

This library exists for historical reasons; it contains the contents of both libevent_core and libevent_extra. You shouldn’t use it; it may go away in a future version of Libevent.

这个不要用,它未来可能会去除掉

The following libraries are installed only on some platforms:

libevent_pthreads

This library adds threading and locking implementations based on the pthreads portable threading library. It is separated from libevent_core so that you don’t need to link against pthreads to use Libevent unless you are actually using Libevent in a multithreaded way.

这个库添加了线程库支持,默认不用链接

libevent_openssl

This library provides support for encrypted communications using bufferevents and the OpenSSL library. It is separated from libevent_core so that you don’t need to link against OpenSSL to use Libevent unless you are actually using encrypted connections.

   如果你想加密网络连接,那么你可以添加上这个库


All current public Libevent headers are installed under the event2 directory. Headers fall into three broad classes:

所有的头文件都在 event2这个文件夹中,其他文件夹的头文件不要用那个是兼容老版本的

API headers

An API header is one that defines current public interfaces to Libevent. These headers have no special suffix.

Compatibility headers

A compatibility header includes definitions for deprecatedfunctions. You shouldn’t include it unless you’re porting a program from an older version of Libevent.

Structure headers

These headers define structures with relatively volatile layouts. Some of these are exposed in case you need fast access to structure component; some are exposed for historical reasons. Relying on any of the structures in headers directly can break your program’s binary compatibility with other versions of Libevent, sometimes in hard-to-debug ways. These headers have the suffix "_struct.h"

(There are also older versions of the Libevent headers without the event2 directory. See "If you have to work with an old version of Libevent" below.)



0 0
原创粉丝点击