• 大小: 31.09MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-06-15
  • 语言: C/C++
  • 标签: libevent    C++封装  

资源简介

windows平台下对于服务器高并发的网络模型选型中,使用libevent是个不错的选择。 本文的背景基于:国内博客对于libevent大多介绍Linux实现,大多是C语言的实现,Windows平台下C++相对较少或者较旧。 本文针对libevent从服务端、客户端两个角度实现了封装类,真正做到,我们在使用封装类时候,只需要关注业务逻辑的处理,不需要关注socket的通信的细节。

资源截图

代码片段和文件信息

// simLibeventClient.cpp : 定义控制台应用程序的入口点。
//

#include “stdafx.h“
#include “yuLibEventClient.h“

/*
**@author: laoyang360
**@date:   20161211
**@brief:  The client of SimLibeventClient
*/

static const int s_iPort = 9999;

int main(int argc char** argv)
{
YuLibeventClient myLibClient;
myLibClient.init(s_iPort);
myLibClient.start();
myLibClient.stop();

printf(“finished \n“);

system(“pause“);
return 0;
}







 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        256  2016-12-11 22:52  libevent_demo\readme.txt

     文件     205312  2016-12-11 21:51  libevent_demo\simLibeventClient\Debug\simLibeventClient.exe

     文件        406  2016-12-11 17:40  libevent_demo\simLibeventClient\Debug\simLibeventClient.exe.manifest

     文件     733144  2016-12-11 21:51  libevent_demo\simLibeventClient\Debug\simLibeventClient.ilk

     文件    1059840  2016-12-11 21:51  libevent_demo\simLibeventClient\Debug\simLibeventClient.pdb

     文件   46858240  2016-12-11 20:32  libevent_demo\simLibeventClient\ipch\simlibeventclient-b3a71e0f\simlibeventclient-b980e3ad.ipch

     文件       2548  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\cl.command.1.tlog

     文件      47014  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\CL.read.1.tlog

     文件       2416  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\CL.write.1.tlog

     文件       2018  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\link.command.1.tlog

     文件       4002  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\link.read.1.tlog

     文件       1200  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\link.write.1.tlog

     文件        566  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\mt.command.1.tlog

     文件        398  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\mt.read.1.tlog

     文件        398  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\mt.write.1.tlog

     文件       1819  2016-12-11 17:40  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.Build.CppClean.log

     文件        381  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.exe.intermediate.manifest

     文件         72  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.lastbuildstate

     文件       2360  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.log

     文件      50795  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.obj

     文件    1179648  2016-12-11 17:40  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.pch

     文件        707  2016-12-11 21:47  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.vcxprojResolveAssemblyReference.cache

     文件          0  2016-12-11 17:40  libevent_demo\simLibeventClient\simLibeventClient\Debug\simLibeventClient.write.1.tlog

     文件      12275  2016-12-11 17:40  libevent_demo\simLibeventClient\simLibeventClient\Debug\stdafx.obj

     文件     748544  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\vc100.idb

     文件     356352  2016-12-11 21:51  libevent_demo\simLibeventClient\simLibeventClient\Debug\vc100.pdb

     文件      65594  2016-12-11 21:47  libevent_demo\simLibeventClient\simLibeventClient\Debug\yuLibEventClient.obj

     文件      30737  2016-12-11 18:10  libevent_demo\simLibeventClient\simLibeventClient\include\event2\buffer.h

     文件      28619  2016-12-11 11:17  libevent_demo\simLibeventClient\simLibeventClient\include\event2\bufferevent.h

     文件       4448  2012-02-11 06:17  libevent_demo\simLibeventClient\simLibeventClient\include\event2\bufferevent_compat.h

............此处省略131个文件信息

评论

共有 条评论