Code Monkey home page Code Monkey logo

Comments (3)

t-cas avatar t-cas commented on August 19, 2024

Your call to close() worked well, you can see it wit the print of is_active().
It's simply that any function (like get_command_output) that requires an open session to work, will try first to transparently open (or re-open) the current session for you.
So in fact, in most of the cases you don't need to explicitly call open() as it will be done for you when you really need it.

from jumpssh.

BharthishAthreya avatar BharthishAthreya commented on August 19, 2024

Thanks a lot for the reply. So closing the session at the end of our functions will do, right? Thanks once again

from jumpssh.

t-cas avatar t-cas commented on August 19, 2024

yes, it will work, just to give you more details, you have several possibilities to ensure sessions are closed, depending on when you want them to be closed:

  • close it explicitly when needed
  • use context manager so it will be closed automatically at the end of block
  • don't do anything, it will be closed automatically when SSHSession instance is garbage collected

from jumpssh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.