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
I've got the same trouble in my similar codes. I followed the suggestion of doing initialization each time before calling select() and it works. In codes at this case, just bringing the two lines into loop will make it work.