Linux under the epoll mechanism I no longer elaborated, on-line to find a lot of information and examples, found and I want to function completely different, so I wrote a.
Implementation of the function is that there are many clients connected to the server at the same time, for example, s for the server, there are client A and client B to connect to the server, they need to verify the password, if a first connected to the server, then do not enter a password, b and then connect the server, at this time, b enter the password, the server Can. I give the example, can be implemented: if a is connected to a server without entering a password, b then connect, this is the server can generate a thread for B, confirm B's password, the client's CLIENT_SOCKFD added to the epoll handle.
This article is from the "8628864" blog, please be sure to keep this source http://8638864.blog.51cto.com/8628864/1677544
Epoll mechanism for multi-user concurrent connection under Linux