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

Add explicit close and context manager to Connection #16

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

JacobCallahan
Copy link
Owner

This commit introduces a new close method that will close the session on a Connection object. However, ssh2-rs states that this will not close the underlying socket. If that's an issue in the future, perhaps we also track the TCP connection and close that along with the session.

Since we're now allowing explicit closing, I also added a context manager to the Connection class, so people can handle that implicitly.

Fixes #15

@JacobCallahan JacobCallahan added the enhancement New feature or request label Oct 1, 2024
This commit introduces a new close method that will close the session on
a Connection object. However, ssh2-rs states that this will not close
the underlying socket. If that's an issue in the future, perhaps we also
track the TCP connection and close that along with the session.

Since we're now allowing explicit closing, I also added a context
manager to the Connection class, so people can handle that implicitly.

I also bumped the supported Python versions included 3.13 (and
pre-releases).

Fixes #15
@JacobCallahan JacobCallahan merged commit 69643fd into master Oct 8, 2024
10 checks passed
@JacobCallahan JacobCallahan deleted the closing_time branch October 8, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No Connection.close() ?
1 participant