Code Monkey home page Code Monkey logo

Comments (6)

tpitale avatar tpitale commented on July 19, 2024

It seems like checking for @session.closed? in this loop: https://github.com/net-ssh/net-ssh-gateway/blob/master/lib/net/ssh/gateway.rb#L196-L201 could be the start of detecting a closed connection.

If @delano or @jamis have any perspective on how they'd like to alert the gateway, I'd be happy to send a PR.

from net-ssh-gateway.

tpitale avatar tpitale commented on July 19, 2024

Could be as simple as adding a method on the gateway instance to check for @session.closed?, leave it up to the user to watch for closed connections.

from net-ssh-gateway.

mfazekas avatar mfazekas commented on July 19, 2024

Can you detail the concrete usecase?

from net-ssh-gateway.

tpitale avatar tpitale commented on July 19, 2024

Servers A, B, and C. A => B => C, with B acting as a tunnel/gateway. If B or C close the connection from their end, there does not appear to be away to ask the ruby gateway instance if the connection is still active, to take action (like restarting a process or killing a DB connection).

from net-ssh-gateway.

mfazekas avatar mfazekas commented on July 19, 2024

Thanks. Net-ssh-gateway is in maitanance mode, and AFAIK we have no plans to extend it to support your usecase.
You should be able to subclass Gateway and get access to @session but it's tricky business because of the locking, another option might be forking the library. Then we can discuss if/in what way we can integrate those changes.

from net-ssh-gateway.

tpitale avatar tpitale commented on July 19, 2024

I can send a PR @mfazekas.

from net-ssh-gateway.

Related Issues (10)

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.