I have a problem about select function when I worked on a Linux socket program. The select function worked fine as the man page says if the client connected the server side
The 'select()' function is frustrating to use; you have to set up its arguments each time before you call it because it modifies them. What you are seeing is a demonstration of what happens if you don't set up the fd_set(s) each time around the loop.