Connect takes too long

0 votes
asked Apr 20 by Almis (220 points)
using (Stream stream = assembly.GetManifestResourceStream(resourceName))
{
    await client.ConnectAsync(host, port); // about 15 sec here
    await client.LoginAsync(username, new Rebex.Net.SshPrivateKey(stream)); // and 2 sec here
}

When I'm trying to connect it takes about 17 seconds to connect, with WinSCP it takes about 4. Is there is something that I can do?

Applies to: Rebex SFTP

1 Answer

+1 vote
answered Apr 20 by Lukas Pokorny (124,570 points)
selected Apr 21 by Almis
 
Best answer

By default, Rebex components on Xamarin.Android use a managed implementation of Diffie-Hellman key exchange algorithm which is quite slow. A faster version based on Android API is available, but it has to be references and enabled.

Please see the following KB article for instructions:
HOWTO: Fast Diffie-Hellman on Xamarin.Android

...