Originally Posted by gdejonge
First. I would expect that if you try to compile that piece of code, your compiler would throw several errors.
But here is a link how to use epoll() how-to-use-epoll-a-complete-example-in-c
Second. Try to restate the problem you try to solve. I'm not sure if I understand your question correctly.
Thank you for your reply.
I've read your link but it can not resolve my problem, because it just create one connect request.
I want to find out which host can respond my connect request in one LAN, so I need connect all hosts in the LAN, then wait for their reply. The most important thing is that I must assume the count of hosts in one LAN is 255 or 255*255, even 255*255*255，and if I connect one by one in a thread, there must be more than 255*255(*255) socket file descriptors at one time. So I think this solution is stupid.