+ -
当前位置:首页 → 问答吧 → 大家好,问个问题,关于EPOLL的。。。

大家好,问个问题,关于EPOLL的。。。

时间:2011-10-31

来源:互联网

我看例子 

epoll_event st_ePollEvent[NETENGINE_EPOLL_EVENTMAXCOUNT];

还有 m_ePollfd = epoll_create(NETENGINE_EPOLL_EVENTMAXCOUNT);

这两个是可以处理的所有SOCKET集合? 也就是我如果定义了1024 那就是说 我的EPOLL只能处理1024个客户 对不?

作者: aaadddzxc   发布时间: 2011-10-31

印象中
1.EPOLL是个链表,链表自然和内存有关了,所以可以无限大
2.select是有限制的

作者: dd_zhouqian   发布时间: 2011-10-31

SYNOPSIS
  #include <sys/epoll.h>

  int epoll_create(int size);
  int epoll_create1(int flags);

DESCRIPTION
  epoll_create() creates an epoll "instance", requesting the kernel to allocate an event backing store dimensioned for size descriptors. The size
  is not the maximum size of the backing store but just a hint to the kernel about how to dimension internal structures. (Nowadays, size is unused;
  see NOTES below.)


看帮助说话,size只是一个建议值,告知内核提前做好这么大size的准备,实际使用时候epoll_wait能够等待的file数可以超过size,现在size已经废弃了。

作者: qq120848369   发布时间: 2011-10-31