why select() always return 0 after the first timeout

后端 未结 5 1431
难免孤独
难免孤独 2020-12-01 22:17

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

5条回答
  •  暖寄归人
    2020-12-01 22:56

    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.

提交回复
热议问题