server connect: max try 7 times

This commit is contained in:
lollipopkit
2023-02-01 13:34:45 +08:00
parent 04cf5b65ce
commit 2faea10d61
7 changed files with 41 additions and 11 deletions

View File

@@ -15,7 +15,11 @@ List<SSHKeyPair> loadIndentity(String key) {
}
Future<SSHClient> genClient(ServerPrivateInfo spi) async {
final socket = await SSHSocket.connect(spi.ip, spi.port);
final socket = await SSHSocket.connect(
spi.ip,
spi.port,
timeout: const Duration(seconds: 5),
);
if (spi.pubKeyId == null) {
return SSHClient(
socket,