This bug happened to me for two days, that is, the Select function resets the timeout parameter value every time it is called in Linux,
Therefore, you need to reset the timeout before calling the select function every time (the timeout is not reset under the window ).
Bytes ---------------------------------------------------------------------------------------------
On Linux, select () modifies timeout to reflect the amount of time not
Slept; most other implementations do not do this. (The POSIX.1-2001 per-
MITS either behaviour.) This causes problems both when Linux code
Which reads timeout is ported to other operating systems, and when code
Is ported to Linux that reuses a struct timeval for multiple select () S
In a loop without reinitializing it. Consider timeout to be undefined
After Select () returns.
Bytes ---------------------------------------------------------------------------------------------