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

Unblock Accept() when Socket closes #53

Closed asticode closed 1 year ago

asticode commented 2 years ago

Hi

I've tried the echo-receiver example and it works great!

However if I close the "main" socket in a goroutine, Accept() keeps on blocking and the for loop never ends 😱

Is it desired behavior?

Cheers

asticode commented 2 years ago

Additionally, and I don't know whether it's part of your plans, that would be awesome to be able to have an API similar to GO's http package with its Server struct that has a ListenAndServe func that basically blocks on Accept() and a Shutdown func that shutdowns the server gracefully and unblocks the ListenAndServe() call.

Again, if you feel like it and point me to the right direction, I'd be happy to submit a PR to add that.

asticode commented 1 year ago

FYI I've finally decided to write my own srt GO package. You can check it out if you're encountering the same problems.

Cheers