How epoll detect clientside close in Python?

后端 未结 10 593
清歌不尽
清歌不尽 2021-02-04 21:22

Here is my server

\"\"\"Server using epoll method\"\"\"

import os
import select
import socket
import time

from oodict import OODict

addr = (\         


        
10条回答
  •  暖寄归人
    2021-02-04 21:45

    Don't you just need to combine the masks together to make use of EPOLLHUP and EPOLLIN at the same time:

    
    epoll.register(sk.fileno(), select.EPOLLIN | select.EPOLLHUP)
    
    

    Though to be honest I'm not really familiar with the epoll library, so it's just a suggestion really...

提交回复
热议问题