摘要: 示例代码 #include "apue.h" #include <dirent.h> #include <limits.h> #include <time.h> /* function type that is called for each filename */ typedef int Myfu 阅读全文
posted @ 2021-10-05 22:13 feiwatson 阅读(60) 评论(0) 推荐(0) 编辑
摘要: Muduo is a multithreaded C++ network library based on the reactor pattern. https://github.com/chenshuo/muduo https://github.com/chenshuo/muduo-tutoria 阅读全文
posted @ 2021-10-05 13:49 feiwatson 阅读(33) 评论(0) 推荐(0) 编辑
摘要: 执行流程: 1、创建监听 socket,并绑定、监听; 2、调用 epoll_create() , 创建 epollfd 代理; 3、将想要监听的 listenfd,通过 epoll_ctl() , 挂载到 epollfd 上,让 epollfd 代理监听; 4、在一个 while 循环中,调用 e 阅读全文
posted @ 2021-10-05 13:42 feiwatson 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 在unix系统中, 通常write只是将数据排入队列,而实际的写磁盘操作则可能在之后的某个时刻。而数据库系统则需要使用O_SYNC,write直至数据写到磁盘上再返回。这样,当它从write返回时就知道数据已经确实写到磁盘 函数dup 和 dup2 dup 和dup2都可以用来复制一个现有的文件描述 阅读全文
posted @ 2021-10-05 11:05 feiwatson 阅读(27) 评论(0) 推荐(0) 编辑