免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1952 | 回复: 1
打印 上一主题 下一主题

[其他] epoll 挺混乱的, 不知是不是水平不够 [复制链接]

论坛徽章:
3
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:032015年亚洲杯之中国
日期:2015-04-22 15:52:45
1 [报告]
发表于 2015-12-08 10:56 |显示全部楼层
本帖最后由 hanxin83 于 2015-12-08 11:01 编辑

补充一个, 异步connect还会直接返回成功....(在连接本机IP的情况下)
PS, 没碰到过EPOLLHUP|EPOLLOUT楼主的情况.......
  1.        +--------------------------------------------------------------------------+
  2.        |                               I/O events                                 |
  3.        +-----------+-----------+--------------------------------------------------+
  4.        |Event      | Poll flag | Occurrence                                       |
  5.        +-----------+-----------+--------------------------------------------------+
  6.        |Read       | POLLIN    | New data arrived.                                |
  7.        +-----------+-----------+--------------------------------------------------+
  8.        |Read       | POLLIN    | A connection setup has been completed (for  con- |
  9.        |           |           | nection-oriented sockets)                        |
  10.        +-----------+-----------+--------------------------------------------------+
  11.        |Read       | POLLHUP   | A  disconnection  request  has been initiated by |
  12.        |           |           | the other end.                                   |
  13.        +-----------+-----------+--------------------------------------------------+
  14.        |Read       | POLLHUP   | A connection is broken (only for connection-ori- |
  15.        |           |           | ented  protocols).   When  the socket is written |
  16.        |           |           | SIGPIPE is also sent.                            |
  17.        +-----------+-----------+--------------------------------------------------+
  18.        |Write      | POLLOUT   | Socket has enough send buffer space for  writing |
  19.        |           |           | new data.                                        |
  20.        +-----------+-----------+--------------------------------------------------+
  21.        |Read/Write | POLLIN|   | An outgoing connect(2) finished.                 |
  22.        |           | POLLOUT   |                                                  |
  23.        +-----------+-----------+--------------------------------------------------+
  24.        |Read/Write | POLLERR   | An asynchronous error occurred.                  |
  25.        +-----------+-----------+--------------------------------------------------+
  26.        |Read/Write | POLLHUP   | The other end has shut down one direction.       |
  27.        +-----------+-----------+--------------------------------------------------+
  28.        |Exception  | POLLPRI   | Urgent data arrived.  SIGURG is sent then.       |
  29.        +-----------+-----------+--------------------------------------------------+
复制代码

论坛徽章:
3
2015年辞旧岁徽章
日期:2015-03-03 16:54:152015年迎新春徽章
日期:2015-03-04 09:49:032015年亚洲杯之中国
日期:2015-04-22 15:52:45
2 [报告]
发表于 2015-12-08 11:02 |显示全部楼层
我的世界比较单纯, 基本上只碰到man手册里的情况
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP