libevent for qt网络模块,直接替换qt的select模型,支持epoll,select,pool.使用非常简单,无需修改以前的代码结构

上传者: rushroom | 上传时间: 2025-06-21 17:16:49 | 文件大小: 19KB | 文件类型: RAR
最近在开发im服务器 需要大并发链接 QT默认的是使用select模型的 这种轮询方式非常慢 在高并发连接 我们需要epoll才能发挥linux服务器的性能 而且使用简单 整个服务端代码架构无需修改 直接可以使用 只要在 main文件添加: int main int argc char argv[] { #ifdef Q OS LINUX QCoreApplication::setEventDispatcher new EventDispatcherLibEvent ; qInstallMessageHandler customMessageHandler ; #endif QCoreApplication a argc argv ; auto ser new ConfigServer; ser >startServer ; return a exec ; } 在 pro文件添加 linux{ LIBS + levent core SOURCES + common eventdispatcher libevent eventdispatcher libevent cpp common eventdispatcher libevent eventdispatcher libevent config cpp common eventdispatcher libevent eventdispatcher libevent p cpp common eventdispatcher libevent socknot p cpp common eventdispatcher libevent tco eventfd cpp common eventdispatcher libevent tco pipe cpp common eventdispatcher libevent tco cpp common eventdispatcher libevent timers p cpp HEADERS + common eventdispatcher libevent common h common eventdispatcher libevent eventdispatcher libevent h common eventdispatcher libevent eventdispatcher libevent config h common eventdispatcher libevent eventdispatcher libevent config p h common eventdispatcher libevent eventdispatcher libevent p h common eventdispatcher libevent libevent2 emul h common eventdispatcher libevent qt4compat h common eventdispatcher libevent tco h common eventdispatcher libevent wsainit h } 可以直接跨平台了使用了 csdn博客:http: blog csdn net rushroom">最近在开发im服务器 需要大并发链接 QT默认的是使用select模型的 这种轮询方式非常慢 在高并发连接 我们需要epoll才能发挥linux服务器的性能 而且使用简单 整个服务端代码架构无需修改 直接可以使用 只要在 main文件添加: [更多]

文件下载

资源详情

[{"title":"( 20 个子文件 19KB ) libevent for qt网络模块,直接替换qt的select模型,支持epoll,select,pool.使用非常简单,无需修改以前的代码结构","children":[{"title":"eventdispatcher_libevent","children":[{"title":"eventdispatcher_libevent_config.cpp <span style='color:#111;'> 2.73KB </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent.h <span style='color:#111;'> 1.75KB </span>","children":null,"spread":false},{"title":"tco_win32_libevent.cpp <span style='color:#111;'> 1.82KB </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent.cpp <span style='color:#111;'> 10.18KB </span>","children":null,"spread":false},{"title":"tco.h <span style='color:#111;'> 664B </span>","children":null,"spread":false},{"title":"tco.cpp <span style='color:#111;'> 730B </span>","children":null,"spread":false},{"title":"common.h <span style='color:#111;'> 771B </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_qpa.h <span style='color:#111;'> 638B </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_p.cpp <span style='color:#111;'> 6.89KB </span>","children":null,"spread":false},{"title":"socknot_p.cpp <span style='color:#111;'> 2.50KB </span>","children":null,"spread":false},{"title":"qt4compat.h <span style='color:#111;'> 1.71KB </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_p.h <span style='color:#111;'> 2.51KB </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_qpa.cpp <span style='color:#111;'> 843B </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_config.h <span style='color:#111;'> 1.29KB </span>","children":null,"spread":false},{"title":"wsainit.h <span style='color:#111;'> 771B </span>","children":null,"spread":false},{"title":"timers_p.cpp <span style='color:#111;'> 8.15KB </span>","children":null,"spread":false},{"title":"eventdispatcher_libevent_config_p.h <span style='color:#111;'> 534B </span>","children":null,"spread":false},{"title":"libevent2-emul.h <span style='color:#111;'> 1.18KB </span>","children":null,"spread":false},{"title":"tco_pipe.cpp <span style='color:#111;'> 3.35KB </span>","children":null,"spread":false},{"title":"tco_eventfd.cpp <span style='color:#111;'> 2.49KB </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明