I have this thread in my application that controls a set of client sockets. I use select() to block until the client makes a request so that I can handle it efficiently without multiplying the threads.
Now the problem is that when I add a new client to the list of clients, I have to wait for the select() timeout (set to 10 seconds) to actually add a new socket to the listening sockets.
So, I would like to crack select() before the timeout so that I can immediately listen to the client.
I already have a solution: create a dummy socket, which I always include in the list of listening sockets, and in which I write to make select() crack, but I hope that there will be a better solution.
Edit : I do not have access to eventfd() , because the GLibc that I use is too old (and I do not mean to update it). Therefore, I may have to use fifo or a socket.
Do you know anyone?
Thanks!
Gui13 source share