Here is my server
\"\"\"Server using epoll method\"\"\"
import os
import select
import socket
import time
from oodict import OODict
addr = (\
After I move select.EPOLLHUP handling code to the line before select.EPOLLIN, hup event still cant be got in 'telnet'. But by coincidence I found that if I use my own client script, there are hup events! strange...
And according to man epoll_ctl
EPOLLRDHUP (since Linux 2.6.17)
Stream socket peer closed connection, or shut down writing half of connection. (This flag is especially useful for writing simple code to
detect peer shutdown when using Edge Triggered monitoring.)
EPOLLERR
Error condition happened on the associated file descriptor. epoll_wait(2) will always wait for this event; it is not necessary 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 necessary to set it in
events.
Seems there shall be a EPOLLRDHUP event when remote side closed connection, which is not implemented by python, don't know why