Open michcio53 opened 4 years ago
Same issue, here, for Flutter web:
var client = SSHClient(host: "my.server", port: 22, username: "myUser", passwordOrKey: "myPassword",);
debugPrint("Debut des actions avec le FTP...");
try {
client.connect().then((String result) {
debugPrint("ConnectResult : " + result);
client.connectSFTP().then((String result) {
debugPrint("ConnectFTPResult : " + result);
client.sftpDownload(path: "./cours/$file", toPath: "./cours/$file").then((String resultDownload) {
debugPrint("GetFileResult : " + resultDownload);
client.disconnectSFTP().then((dynamic result){
client.disconnect();
OpenFile.open("./cours/$file").then((String result) {
debugPrint("Open file result : " + result);
});
});
});
});
});
} on PlatformException catch (e) {
debugPrint('Error: ${e.code}\nError Message: ${e.message}');
}
The app displays the first log and hangs there...
EDIT: Working on Android.
Hi,
Are you able to debug the app in XCode or Android Studio? (Not sure if it's possible with Flutter web.)
Please set a breakpoint in the connectToHost() function then step in to see where it gets stuck.
For iOS: https://github.com/shaqian/flutter_ssh/blob/master/ios/Classes/SshPlugin.m#L114 For Android: https://github.com/shaqian/flutter_ssh/blob/master/android/src/main/java/sq/flutter/ssh/SshPlugin.java#L215
Thanks, Qian
Does it work on Flutter web chanel? After calling client.connect() there is no exception and the function never ends. It never goes to the next line, it looks like it is all the time doing something. There is no timeout also.
When doing stream from await connect() it is blocking the app.
How to solve it?