05 2023 档案
摘要:## 一、IO设备操作介绍 The QIODevice class is the base interface class of all I/O devices in Qt.QIODevice provides both a common implementation and an abstract
阅读全文
摘要:引言 在使用socket编程时,我们会用到accept、connect、recv、send等函数,这些函数在没有数据到达时,会阻塞等待IO数据的到达。 这不利于我们处理多个连接并快速响应。一种方案是,服务端每accept一个连接,就创建一个新的线程用来处理这个连接。这会导致线程过多, 而且线程之前切
阅读全文
摘要:epoll基本原理 epoll 相对于 select 与 poll 有较大的不同,主要是针对前面两种多路复用 IO 接口的不足 与 select/poll 方案对比 select 方案使用数组存储文件描述符,最大支持 1024 select 每次调用都需要将描述符集合拷贝到内核中,非常消耗资源 po
阅读全文