Open kyrias opened 1 month ago
Hi @kyrias Is it possible to implement it yourself? P.S. I have not tested the following code, but this is what it means
{
let session = session.clone();
tokio::spawn(async move {
loop {
let n = session.keepalive_send().await.unwrap();
tokio::time::sleep(tokio::time::Duration::from_secs(n)).await;
}
}
}
Based on the API one would expect that calling
connect
with aSessionConfiguration
that hasset_keepalive
set with an interval above 0 to result in keep-alives being automatically issued. However as per thelibssh2
docs:(As an aside, it's unfortunate that the
ssh2
crate's docs doesn't include this note.)It would be nice if the
async-ssh2-lite
crate implemented its own keep-alive support to make the above option function.