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

Feature Request: Support KeepAlive Option #48

Open
jooy2 opened this issue Dec 1, 2022 · 1 comment
Open

Feature Request: Support KeepAlive Option #48

jooy2 opened this issue Dec 1, 2022 · 1 comment
Assignees

Comments

@jooy2
Copy link

jooy2 commented Dec 1, 2022

Hello. Thanks for creating & developing the dartssh2 project.

I am developing a terminal app with shell interaction using dartssh2.

Are the KeepAliveInterval and KeepAliveCountMax values configurable via dartssh2 options on the client?

I looked for a similar issue below but couldn't find the answer I was looking for.
#27

If not, hopefully a feature will be added in the future.

Regards,


(Please ignore the problem I had below. It was a hardware issue with my development rig.)

When the SSH connection is completed, the connection is forcibly closed after a certain amount of time with the error below.

(An error is displayed when a key input is attempted after a certain amount of time has elapsed.)

E/flutter (21226): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SSHStateError(Transport is closed)
E/flutter (21226): #0      SSHTransport.sendPacket (package:dartssh2/src/ssh_transport.dart:183:7)
E/flutter (21226): #1      SSHClient._sendMessage (package:dartssh2/src/ssh_client.dart:460:16)
E/flutter (21226): #2      SSHChannelController._sendEOFIfNeeded (package:dartssh2/src/ssh_channel.dart:269:16)
E/flutter (21226): #3      SSHChannelController.close (package:dartssh2/src/ssh_channel.dart:200:5)
E/flutter (21226): #4      SSHClient._closeChannels (package:dartssh2/src/ssh_client.dart:428:15)
E/flutter (21226): #5      SSHClient._onTransportClosed (package:dartssh2/src/ssh_client.dart:447:5)
E/flutter (21226): #6      new SSHClient.<anonymous closure> (package:dartssh2/src/ssh_client.dart:161:23)
E/flutter (21226): #7      _RootZone.runUnary (dart:async/zone.dart:1653:54)
E/flutter (21226): #8      _FutureListener.handleError (dart:async/future_impl.dart:165:22)
E/flutter (21226): #9      Future._propagateToListeners.handleError (dart:async/future_impl.dart:778:47)
E/flutter (21226): #10     Future._propagateToListeners (dart:async/future_impl.dart:799:13)
E/flutter (21226): #11     Future._completeError (dart:async/future_impl.dart:574:5)
E/flutter (21226): #12     Future._asyncCompleteError.<anonymous closure> (dart:async/future_impl.dart:665:7)
E/flutter (21226): #13     _microtaskLoop (dart:async/schedule_microtask.dart:40:21)
E/flutter (21226): #14     _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)

Connection code

connect() async {
    final socket = await SSHSocket.connect('host', 'port');

    _client = SSHClient(
      socket,
      username: 'username',
      onPasswordRequest: () {
        return 'password';
      },
    );

    _shell = await _client.shell();
}

pubspec.yarn

dependencies:
  flutter:
    sdk: flutter

  dartssh2: 2.7.3
@jooy2
Copy link
Author

jooy2 commented Dec 12, 2022

This problem has been confirmed to occur in a my development environment. So, you can ignore the above problem. Sorry for the confusion.

However, it would be nice to have a parameter option to customize keepAlive. Therefore, I will put this issue on hold until there is an answer.

@jooy2 jooy2 changed the title After a certain amount of time, the open session is closed. (Support KeepAlive feature) Feat: Support KeepAlive Option Dec 12, 2022
@xtyxtyx xtyxtyx self-assigned this Dec 12, 2022
@jooy2 jooy2 changed the title Feat: Support KeepAlive Option Feature Request: Support KeepAlive Option Dec 20, 2022
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

No branches or pull requests

2 participants