schollz / peerdiscovery

Pure-Go library for cross-platform local peer discovery using UDP multicast :woman: :repeat: :woman:
MIT License
644 stars 56 forks source link

Fix StopChan behaviour #14

Closed robpre closed 4 years ago

robpre commented 4 years ago

This seems to fix the exit behaviour, since the exit variable was created for the for loop scope, setting it to true at the end of the loop meant it wasn't being caught by the check on line 214.

I wasn't sure if we should just move the if to under the select, but this seemed like the lowest-impact fix.

Thanks for this module! :)

robpre commented 4 years ago

Thanks, that was what I was (poorly) suggesting with my second paragraph. :)

I'll update the PR.

schollz commented 4 years ago

Looks good! I'll give it a check soon 😊

Appreciate your help greatly @robpre and @geistesk

robpre commented 4 years ago

Thank you for the merge!