2017年11月9日

Libevent 反应堆的初始化

摘要: // 默认情况下new eventbase struct event_base * event_base_new(void) { struct event_base *base = NULL; //初始化系统配置 struct event_config *cfg = event_config_new(); // 使用默认的配置方法 if (cfg) { ... 阅读全文

posted @ 2017-11-09 16:38 沐浴凌风 阅读(393) 评论(1) 推荐(0) 编辑

Libevent(2.1.8)中的事件结构和管理

摘要: Libevent(2.1.8)中的事件结构体 这里的libevent版本为 2.1.8 。 libevent中事件的结构体struct event,定义在event_struct.h 中, 这里我们简单看一下: 这里可以看到这个版本下的event 结构体比之前的好像少了不少东西, 如之前的结构: 这 阅读全文

posted @ 2017-11-09 15:21 沐浴凌风 阅读(473) 评论(0) 推荐(0) 编辑

epoll 惊群处理

摘要: 1 #include <sys/types.h> 2 #include <sys/socket.h> 3 #include <sys/epoll.h> 4 #include <netdb.h> 5 #include <string.h> 6 #include <stdio.h> 7 #include 阅读全文

posted @ 2017-11-09 13:13 沐浴凌风 阅读(723) 评论(0) 推荐(0) 编辑

导航