Hi,
Thanks for having a look. Interesting. The 'server' is a proprietary Linux device we manufacture. I need to investigate further.
The way you use the ScpClient is different to my implementation, I wonder if I'm using it wrong. Here is a code frag of my code:
Thanks for having a look. Interesting. The 'server' is a proprietary Linux device we manufacture. I need to investigate further.
The way you use the ScpClient is different to my implementation, I wonder if I'm using it wrong. Here is a code frag of my code:
using (var stream = new MemoryStream((128 * 1024)))
{
var hasError = false;
using (var scpClient = new ScpClient(XXX.IpAddress, XXX.UserName, XXX.Password))
{
scpClient.ErrorOccurred += (x, y) => hasError = true;
scpClient.BufferSize = BufferSize;
scpClient.Connect();
if (scpClient.IsConnected && !hasError)
{
try
{
scpClient.Download(_sourcePath, stream);
}
catch (ScpException exception)
{
// logging stuff here ... do get the "file or directory not found".
}
scpClient.Disconnect();
}
}
// consume stream here as 'stream.ToArray()'
}