pub fn is_alive(stream: &tokio::net::TcpStream) -> bool {
match stream.try_io(tokio::io::Interest::READABLE, || {
let sock = socket2::SockRef::from(stream);
let mut buf = [std::mem::MaybeUninit::uninit()];
sock.peek(&mut buf)
}) {
Err(e) if e.kind() == std::io::ErrorKind::WouldBlock => true, Ok(0) | Err(_) => false, Ok(_) => true, }
}