Libevent
MYTCHITOS
这个作者很懒,什么都没留下…
展开
-
Libevent book 笔记(11) Connection listeners accepting TCP connections
文章目录Creating or freeing an evconnlistenerevconnlistener_newevconnlistener_new_bindevconnlistener_freeRecognized flagsThe connection listener callbackEnabling and disabling an evconnlistenerevconnlistener_disableevconnlistener_enableAdjusting an evconnliste原创 2020-05-26 18:40:56 · 333 阅读 · 0 评论 -
Libevent book 笔记(10) Evbuffers utility functionality for buffered IO
文章目录Creating or freeing an evbufferevbuffer_newevbuffer_freeEvbuffers and Thread-safetyevbuffer_enable_lockingevbuffer_lockevbuffer_unlockInspecting an evbufferevbuffer_get_lengthevbuffer_get_contiguous_spaceAdding data to an evbuffer: basicsevbuffer_addev原创 2020-05-26 18:35:59 · 386 阅读 · 0 评论 -
Libevent book 笔记(9) Bufferevents advanced topics
文章目录Paired buffereventsbufferevent_pair_newbufferevent_pair_get_partnerFiltering buffereventsbufferevent_filter_newLimiting maximum single read/write sizebufferevent_set_max_single_readbufferevent_set_max_single_writebufferevent_get_max_single_readbufferev原创 2020-05-26 18:10:44 · 473 阅读 · 0 评论 -
Libevent book 笔记(8) Bufferevents concepts and basics
文章目录Bufferevents and evbuffersCallbacks and watermarksDeferred callbacksOption flags for buffereventsWorking with socket-based buffereventsCreating a socket-based buffereventbufferevent_socket_newLaunching connections on socket-based buffereventsbuffereven原创 2020-05-26 17:53:00 · 289 阅读 · 0 评论 -
Libevent book 笔记(7) Utility and portability functions
Helper functions and types for Libevent文章目录Helper functions and types for LibeventBasic typesevutil_socket_tStandard integer typesMiscellaneous compatibility typesTimer portability functionsevutil_timeraddevutil_timersubevutil_timerclearevutil_timerissete原创 2020-05-26 17:19:46 · 346 阅读 · 0 评论 -
Libevent book 笔记(6) Working with events
文章目录Constructing event objects`event_new()/event_free()`例子The event flagsAbout Event PersistenceCreating an event as its own callback argumentevent_self_cbarg例子Timeout-only eventsConstructing signal events例子Caveats when working with signalsSetting up event原创 2020-05-26 17:12:24 · 346 阅读 · 0 评论 -
Libevent book 笔记(5) Running an event loop
文章目录Running the loopevent_base_loopevent_base_dispatchStopping the loop接口例子: Shut down immediately例子: Run an event loop for 10 seconds, then exit.Re-checking for eventsevent_base_loopcontinueChecking the internal time cacheevent_base_gettimeofday_cachedeve原创 2020-05-26 16:22:02 · 214 阅读 · 0 评论 -
Libevent book 笔记(4) Getting an event_base
文章目录Creating an event_baseSetting up a default event_baseevent_base_newSetting up a complicated event_baseevent_configevent_config_avoid_methodevent_config_require_featuresevent_config_set_flagevent_config_set_num_cpus_hintevent_config_set_max_dispatch_int原创 2020-05-26 16:15:06 · 224 阅读 · 0 评论 -
Libevent book 笔记(3) Setting up the Libevent library
文章目录Log messages in Libevent接口例子调试记录Handling fatal errors接口Memory management接口例子注意Locks and threadingPtheads和Windows接口其它接口例子Debugging lock usage接口注意Debugging event usage接口注意例子Detecting the version of Libevent接口例子:编译时检查例子:运行时检查Freeing global Libevent struct原创 2020-05-26 16:03:00 · 305 阅读 · 0 评论 -
Libevent book 笔记(2) Preliminaries
文章目录Libevent from 10,000 feetThe LibrariesThe HeadersIf you have to work with an old version of LibeventLibevent from 10,000 feetlibevent由以下这些组件或者说部分组成:evutil对不同平台的网络实现的一个通用的抽象。或者说,提供了一个通用的接口,封装了底层不同平台的网络实现。主要这里指的是平台的网络模块的抽象或者封装。比方说recv或者send函数在不同平台可原创 2020-05-26 15:51:47 · 188 阅读 · 0 评论 -
Libevent book 笔记(1) A tiny introduction to asynchronous IO
闲话不多说,略过一些无关内容,直接入正题。文章目录第一个例子第二个例子第一个例子/* For sockaddr_in */#include <netinet/in.h>/* For socket functions */#include <sys/socket.h>/* For fcntl */#include <fcntl.h>#include <event2/event.h>#include <assert.h>#in原创 2020-05-26 15:44:32 · 239 阅读 · 0 评论