Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@mus65
Copy link
Contributor

@mus65 mus65 commented Sep 22, 2024

BaseClient.ConnectAsync doesn't respect the connection timeout because the async methods in the lower layers all just check the cancellationToken passed by the caller.

Fix this by creating a linked cancellation token in ConnectAsync and passing this one through the lower layers.

If the timeout is hit, it throws SshOperationTimeoutException (like Connect() does). If the user provided token is cancelled, OperationCanceledException is thrown (as before).

Fixes #1411 .

Copy link
Collaborator

@Rob-Hague Rob-Hague left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@Rob-Hague Rob-Hague merged commit 28e6742 into sshnet:develop Sep 22, 2024
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

Successfully merging this pull request may close these issues.

SftpClient.ConnectAsync hangs

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.