On Monday, September 11, 2017 at 11:36:33 AM UTC-4, James Bardin wrote: > > > Rather than waiting for just the `Listener.Close` call to return, try > waiting for the call to `Listener.Accept()` to return with a non-Temporary > error. That should error as the result of the file descriptor being closed, > and give you the ordering you need. > > Thanks, this was very helpful. I found these links:
https://github.com/golang/go/issues/4373 https://github.com/golang/go/issues/11219 https://github.com/golang/go/commit/fb4b4342fe298fda640bfa74f24b7bd58519deba It should in fact be possible to test either `err.Temporary()` or the actual error string (as in #19252), and then any execution that happens-after a successful test will be able to rebind. Here's what I'm still uncertain about: it's not clear on the basis of the API that the main() goroutine needs to coordinate with any other goroutines in the first place. So it's clear that a goroutine blocking (so to speak) on Accept() requires this coordination, but could there be others? Are there more potential situations in which another goroutine is holding references to the underlying file descriptor? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.