• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            Sheppard Y

            keep thinking keep coding.

            epoll的各個事件觸發(fā)條件測試

            2016-07-03 日更新 
            此篇博客已經(jīng)遷移到新博客,并做行文檢查和優(yōu)化排版:

            1、listen fd,有新連接請求,觸發(fā)EPOLLIN。
            2、對端發(fā)送普通數(shù)據(jù),觸發(fā)EPOLLIN。
            3、帶外數(shù)據(jù),只觸發(fā)EPOLLPRI。
            4、對端正常關(guān)閉(程序里close(),shell下kill或ctr+c),觸發(fā)EPOLLIN和EPOLLRDHUP,但是不觸發(fā)EPOLLERR和EPOLLHUP。
                關(guān)于這點,以前一直以為會觸發(fā)EPOLLERR或者EPOLLHUP
                再man epoll_ctl看下后兩個事件的說明,這兩個應(yīng)該是本端(server端)出錯才觸發(fā)的。
            5、對端異常斷開連接(只測了拔網(wǎng)線),沒觸發(fā)任何事件。




            附man:

            EPOLLIN
                          The associated file is available for read(2) operations.
            EPOLLOUT
                          The associated file is available for write(2) operations.
            EPOLLRDHUP
                          Stream  socket peer closed connection, or shut down writing half
                          of connection.  (This flag is especially useful for writing sim-
                          ple code to detect peer shutdown when using Edge Triggered moni-
                          toring.)
            EPOLLPRI
                          There is urgent data available for read(2) operations.
            EPOLLERR
                          Error condition happened  on  the  associated  file  descriptor.
                          epoll_wait(2)  will always wait for this event; it is not neces-
                          sary to set it in events.
            EPOLLHUP
                          Hang  up   happened   on   the   associated   file   descriptor.
                          epoll_wait(2)  will always wait for this event; it is not neces-
                          sary to set it in events.
            EPOLLET
                          Sets  the  Edge  Triggered  behavior  for  the  associated  file
                          descriptor.   The default behavior for epoll is Level Triggered.
                          See epoll(7) for more detailed information about Edge and  Level
                          Triggered event distribution architectures.
            EPOLLONESHOT (since Linux 2.6.2)
                          Sets  the  one-shot behavior for the associated file descriptor.
                          This means that after an event is pulled out with  epoll_wait(2)
                          the  associated  file  descriptor  is internally disabled and no
                          other events will be reported by the epoll interface.  The  user
                          must  call  epoll_ctl() with EPOLL_CTL_MOD to re-enable the file
                          descriptor with a new event mask.

            posted on 2009-03-12 17:17 Sheppard Y 閱讀(22865) 評論(0)  編輯 收藏 引用 所屬分類: c++

            <2025年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            導(dǎo)航

            統(tǒng)計

            留言簿(1)

            隨筆分類(77)

            隨筆檔案(58)

            me

            基友

            同行

            業(yè)界前輩

            最新隨筆

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            综合网日日天干夜夜久久| 亚洲午夜福利精品久久| 精品国产一区二区三区久久久狼| 996久久国产精品线观看| 久久婷婷五月综合色99啪ak | 97久久超碰国产精品2021| 久久久久亚洲av无码专区喷水| 久久天天躁狠狠躁夜夜av浪潮| 狠狠精品久久久无码中文字幕| 亚洲国产精品无码久久久蜜芽| 伊人久久大香线蕉综合5g| 99久久精品国产麻豆| 久久91精品国产91| 一本色道久久88综合日韩精品| 久久国产免费观看精品3| 婷婷久久综合| 一级做a爰片久久毛片看看| 精品国际久久久久999波多野| 久久久久久久波多野结衣高潮| 亚洲人成电影网站久久| 热久久国产欧美一区二区精品| 亚洲国产一成人久久精品| 亚洲国产精品无码久久久久久曰| 久久亚洲欧美日本精品| 青青草国产精品久久久久| 亚洲精品无码专区久久久| 区亚洲欧美一级久久精品亚洲精品成人网久久久久 | 91精品国产高清久久久久久91| 久久成人影院精品777| 久久最近最新中文字幕大全 | 久久久精品人妻一区二区三区蜜桃| 伊人久久大香线蕉综合热线| 久久99精品国产麻豆蜜芽| 四虎国产精品成人免费久久| 91精品婷婷国产综合久久| 国产精品久久精品| 国产成人精品久久一区二区三区| 久久WWW免费人成一看片| 精品国产乱码久久久久久呢| 精产国品久久一二三产区区别 | 亚洲国产精品一区二区三区久久|