I use the poll() function in my program, I read this link to use the POLLRDHUP flag, which you must define _GNU_SOURCE before including all the header files. I need this flag so that the socket polling can tell me whether the client is hanging or not, so that I can finish the corresponding thread.
By the way, I am writing a program on the echo server that can process several clients at the same time, and I use GCC 4.1.2 on OpenSuse Linux Enterprise Server 10.3 (x86_64).
source share