When the poll descriptor is created, it is with a duration of 0, which causes the deadline timer to fire right away and that's waiting the next time a deadline is set up.
If there is a delay between setting up deadlines, and the timer fired after the poll.Wait() had returned, that timer signal is not cleared from the channel and will cause wait to return immediately.
The return value from poll.Wait() is not checked in the Read and Write functions, which will cause a Read to hang if there is no data on the socket.
Fixed a few issues around polling timeouts.
poll.Wait()
had returned, that timer signal is not cleared from the channel and will cause wait to return immediately.poll.Wait()
is not checked in theRead
andWrite
functions, which will cause a Read to hang if there is no data on the socket.