Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What other solution would you want? You could use `SetDeadline` if you like. But closing the connection seems reasonable too.

I think you're framing the problem wrong. You're not asking to shutdown a goroutine, you're asking "How do I abort from a synchronous read from a network connection that is blocked?"



Don't get too hung up on that, it was the least of the problems. Closing the connection works fine, it's just a bit unorthodox. The basic structure of the problem was much more problematic to implement.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: