Please ignore my previous post (pending moderation), Read() on a TCPConn does not return (0, nil).Since I figure I have to deal with the "use of closed network connection" in order to close a connection that's in a Read() call (unless I poll for a closing channel in between setting SetReadDeadline).This is basically the function I have to filter out this error:func checkNetOpError(err error) error {if err != nil {netOpError, ok := err.(*net.OpError)if ok && netOpError.Err.Error() == "use of closed network connection" {return nil}}return err}This seems awkward though; is this the best way to handle this?--
To quote Mr Pike, can you please describe your problem, not your solution.
--
Try +tip, this smells like a windows weirdness that should be expunged in the development version
If you are coping data in both directions then try Shutdown rather than Close, that it what it is there for. You may need to also use a wait group to synchronise the action of the io.Copy in the goroutine and the io.Copy in the main goroutine.
Sorry about that, I was mistaken about the name.