这个bug搞了我两天, 大致就是说select 函数在linux 下 每次调用都会重置timeout参数值, 
所以需要在每次调用select 函数之前, 重新设置timeout (window下面不会重置timeout)。
---------------------------------------------------------------------------------------------

On Linux, select() modifies timeout to reflect the amount of time not
slept; most other implementations do not do this. (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.
 ---------------------------------------------------------------------------------------------

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-01
  • 2021-04-21
  • 2021-09-12
  • 2021-10-10
  • 2021-04-20
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案