Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection timeout in client doesn't take effect #141

Closed
handewo opened this issue Feb 28, 2023 · 3 comments
Closed

Connection timeout in client doesn't take effect #141

handewo opened this issue Feb 28, 2023 · 3 comments

Comments

@handewo
Copy link

handewo commented Feb 28, 2023

 let config = client::Config {
        connection_timeout: Some(Duration::from_secs(5)),
        ..<_>::default()
 };

When I connect to a ssh server that is not existed, the time elapsed during connection with server is longer than connection_timeout.
Is it a useless field in client::Config?

@Eugeny
Copy link
Member

Eugeny commented Feb 28, 2023

The option is somewhat misleadingly named (thrussh legacy) - it's in fact the inactivity timeout after a live connection is closed. If you want to time out when setting up a connection, you can just use tokio::time::timeout. I'll keep this ticket open to rename the option later.

@handewo
Copy link
Author

handewo commented Mar 1, 2023

misleadingly

I got it, but this option looks like doesn't use anywhere.

@Eugeny
Copy link
Member

Eugeny commented Mar 1, 2023

It's used once the connection is running. If there's no messages (keepalive or otherwise) for connection_timeout, it gets disconnected.

@Eugeny Eugeny closed this as completed in 6606e28 Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants