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

bug: Unhandled Exception: SSHStateError(Transport is closed) #86

Open
diybl opened this issue Aug 14, 2023 · 2 comments
Open

bug: Unhandled Exception: SSHStateError(Transport is closed) #86

diybl opened this issue Aug 14, 2023 · 2 comments

Comments

@diybl
Copy link

diybl commented Aug 14, 2023

when the remote reboot or shutdown

the done handler not working.
`await session.done;

client.close();
await client.done;`

the error is.

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: SSHStateError(Transport is closed)
#0 SSHTransport.sendPacket (package:dartssh2/src/ssh_transport.dart:183:7)
#1 SSHClient._sendMessage (package:dartssh2/src/ssh_client.dart:480:16)
#2 SSHChannelController._sendEOFIfNeeded (package:dartssh2/src/ssh_channel.dart:264:16)
#3 SSHChannelController.close (package:dartssh2/src/ssh_channel.dart:195:5)
#4 SSHClient._closeChannels (package:dartssh2/src/ssh_client.dart:447:15)
#5 SSHClient._handleTransportClosed (package:dartssh2/src/ssh_client.dart:467:5)
#6 new SSHClient. (package:dartssh2/src/ssh_client.dart:166:14)

@diybl
Copy link
Author

diybl commented Aug 14, 2023

void sendPacket(Uint8List data) {
if (isClosed) {
return;
throw SSHStateError('Transport is closed');
}

i add return before throw SSHStateError('Transport is closed');
and then temporary solve.

@DevAloshe
Copy link

DevAloshe commented Oct 4, 2023

I have the same error except the error occurs when I connect to my Cisco catalyst switch 2960 serires in the first run I get the result then when using the same client one more time to excute the same command it says :

SSHStateError(Transport is closed)

My Code :

static cisco(SSHClient client) async {
    await client.ping();
    print(await client.run('show env fan'));
    await client.ping();

}

BTW : the same code runs on all other devices very well

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