Haivision / srtgo

Go bindings for SRT. Advantages of SRT technology for an easy to use programming language
Mozilla Public License 2.0
185 stars 52 forks source link

Fix/poll deadline timeout #63

Open markniebur opened 1 year ago

markniebur commented 1 year ago

Fixed a few issues around polling timeouts.

  1. 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.
  2. 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.
  3. 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.