Battling brain cancer at his family ranch in Arizona, 81-year-old Sen. John McCain has been sharing his hopes for the future of the country and reflections on his political life with friends who visit. For former Vice President Joe Biden, McCain's message was a simple one: don't "walk away" from politics, Biden told The New York Times, describing his conversation with the Arizona Republican.

McCain and Biden may be on opposite sides of the aisle, but through their decades in politics they've forged a friendship, as did McCain with Biden's two sons. Biden has yet to make any announcement about whether he will run in 2020, after declining to run in 2016 following the death of his son, Beau. After visiting McCain last weekend at his ranch, Biden told the Times the Arizona senator is still preoccupied with the future of the country.

"Here John knows he's in a very, very, very precarious situation, and yet he's still concerned about the state of the country," Mr. Biden said in an interview. "We talked about how our international reputation is being damaged and we talked about the need for people to stand up and speak out."

Get Breaking News Delivered to Your Inbox

Looking back, McCain has some regrets. In a new HBO documentary, McCain says he wished he had selected his friend Democratic Sen. Joe Lieberman as his running mate in the 2008 presidential race, over firebrand Sarah Palin. McCain calls failing to go against the advice of some advisers to pick Lieberman "another mistake that I made."

Lieberman told the Times he was unaware of McCain's regret over the matter until he watched the documentary, saying, "It touched me greatly."

Intimates of McCain, the Times reports, have told the White House Vice President Mike Pence should attend his funeral, instead of Mr. Trump, with whom McCain has very publicly disagreed.

On the campaign trail, Mr. Trump blasted McCain, saying he likes "people who weren't captured" — McCain spent more than five years as a prisoner of war in Vietnam — and last year, the president attacked McCain for voting against a health care overhaul, after McCain's cancer diagnosis.

McCain, in past remarks and in his new book, has criticized the sitting president's approach to politics, and political climate in the country.

"We are asleep to the necessity of our leadership, and to the opportunities and real dangers of this world," McCain said on the Senate floor in October. "We are asleep in our echo chambers, where our views are always affirmed and information that contradicts them is always fake. We are asleep in our polarized politics, which exaggerates our differences, looks for scapegoats instead of answers."

McCain's new memoir, "The Restless Wave: Good Times, Just Causes, Great Fights and Other Appreciations" will be released on May 22.

"I don't know how much longer I'll be here," McCain says in an audio recording of his book, obtained by NPR. "Maybe I'll have another five years. Maybe with the advances in oncology, they'll find new treatments for my cancer that will extend my life. Maybe I'll be gone before you hear this. My predicament is, well, rather unpredictable. But I'm prepared for either contingency, or at least I'm getting prepared. I have some things I'd like to take care of first, some work that needs finishing, and some people I need to see."