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

Reconnect support #4

Open
torkildr opened this issue Jan 26, 2018 · 2 comments
Open

Reconnect support #4

torkildr opened this issue Jan 26, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@torkildr
Copy link
Contributor

It would be nice to have reconnect ability built into the library somewhere.

This would remove the need to have

xapi
    .on('close', () => {})
    .on('error', (error) => {});

with reconnect logic in client code.

Today, to have reconnect ability, you will have to have event listeners on close and error, which will create a new xapi object, and re-register all feedbacks.

@drkchiloll
Copy link

I probably should have answered this some time ago..Using the Error Event is good practice from my usage..but to keep a connection alive use the following:

xapi.connect('ssh://ip', {
  ...credentials
  keepaliveInterval: IntegerMilliseconds

@drkchiloll
Copy link

Ultimately, this module uses the SSH2 module here: https://github.com/mscdex/ssh2, some of the properties and events for SSH2 are good to know for this module..some methods and properties may not work..your mileage of incorporating these may vary...

@myme myme added the enhancement New feature or request label Jun 3, 2018
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

No branches or pull requests

3 participants