摘要: epoll 是 Linux 内核为处理大批量文件描述符而作了改进的 poll,是 Linux 下多路复用 IO接口 select/poll 的增强版本 在 linux 的网络编程中,很长时间都在使用 select 来做事件触发。在 2.6 内核中,有一种替换它的机制,就是 epoll。 select 与 epoll 区别概述 1、函数使用上:epoll 使用一组函数来完成任务,而不... 阅读全文
posted @ 2018-11-18 21:10 osbreak 阅读(610) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #include<unistd.h> #include<sys/socket.h> #include<netinet/in.h> #include<arpa/inet.h> #includ 阅读全文
posted @ 2018-11-18 21:09 osbreak 阅读(164) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<string.h> #include<unistd.h> #include<sys/socket.h> #include<netinet/in.h> #include<arpa/inet.h> #includ 阅读全文
posted @ 2018-11-18 21:09 osbreak 阅读(186) 评论(0) 推荐(0) 编辑