func getCloseNotifier(conn *srpc.Conn) <-chan error { closeChannel := make(chan error) go func() { for { buf := make([]byte, 1) if _, err := conn.Read(buf); err != nil { closeChannel <- err return } } }() return closeChannel }