Login  
Search All Forums
Dart Home | PowerTCP SFTP & SSH for .NET | Custom Development Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
AuthorForum: PowerTCP SFTP & SSH for .NET
Topic: SSH SFTP Only Downloading 128KB v4.6
sftpdebug

From: USA
Posts: 4
Member Since: 07/10/14
posted July 10, 2014 11:34 AM

Having an issue where SFTP control only downloads first 128K of file from server - 4 pulls of 32KB blocks.

Tried disabling read ahead buffers and issue remains. Will attempt to manipulate block size to see if it tries only 4 pulls or stops at 128KB.

Is this a known issue?
Nick B (Admin)

From: Utica, NY USA
Posts: 567
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted July 10, 2014 12:44 PM

Hello,

This is not a known issue. Are you receiving any exception or is the Error event being raised?

If no exception is thrown, it is likely that the server is sending an EOF message. Do third-party clients function against your server? What server software and version are you connecting to?
sftpdebug

From: USA
Posts: 4
Member Since: 07/10/14
posted July 10, 2014 12:45 PM

We are seeing this w/ multiple SFTP servers.

Increasing the ReadAheadBuffers seems to fix the problem. Is this something we need to make dynamic based on file size?
Nick B (Admin)

From: Utica, NY USA
Posts: 567
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted July 10, 2014 12:59 PM

Can you provide the server software names and versions for servers this occurs on? We would like to attempt to reproduce your report. Or, would you be able to provide us with test access to servers that reproduce this issue? (If yes, send details into support@dart.com)

We don't know the cause of this issue, so I can't say whether it would be dependent upon file size. Once we can reproduce the issue, we may be able to provide more information.

What size are the files you're transferring? Are you receiving any exception or is the Error event raised?

Does this occur with our included SFTP Client sample?
sftpdebug

From: USA
Posts: 4
Member Since: 07/10/14
posted July 10, 2014 3:06 PM

The servers are not ours, so I cannot provide more info or access.

We tried files from 170KB to 1.5MB. No exceptions or errors raised.

The client sample worked. We were suspecting that the issue was when writing the data to a stream vs. a file. We are using a stream in a .NET environment.
Nick B (Admin)

From: Utica, NY USA
Posts: 567
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted July 10, 2014 4:30 PM

All of the Sftp.Get() methods use stream-based transfer internally. I just tested this with no issue:

  FileStream output = new FileStream(localFilepath, FileMode.CreateNew, FileAccess.ReadWrite))
  Stream input = sftp.Get(entry.Path, 0);
  long total = 0;
  byte[] buffer = new byte[32000];
  int read = -1;
  while (read != 0)
  {
    read = input.Read(buffer, 0, 32000);
    total += read;
    output.Write(buffer, 0, read);
  }
  output.Flush();
  output.Close();

Does your issue still occur with the above code? If yes: SSH/SFTP servers will return their server software and version when connecting to them via telnet; please connect to your SFTP servers with a Telnet client (such as Windows command-line telnet), and let us know what the returned greeting message is for some of the servers your issue occurs against.
sftpdebug

From: USA
Posts: 4
Member Since: 07/10/14
posted July 10, 2014 8:50 PM

Nick,

We had code (in VB) that worked perfectly in 4.4.. that same code exhibited the issues I reported with 4.6.

The only solve we could find is to increase the ReadAheadBuffers beyond where ReadAheadBuffers*32K is greater than File Size.

Does it matter that it is a Windows Service? Or is spawning multiple threads? Unsure.

Unfortunately, we can't just plug that code into the project and test it out... though I can ask our dev to check it out if he has the time.
Nick B (Admin)

From: Utica, NY USA
Posts: 567
Member Since: 05/25/10

Extra Support Options
Custom Application Development

posted July 11, 2014 11:36 AM

Hello,

Use in a Windows Service should not be any different from use in a Windows Forms application. When you say 'spawning multiple threads', are you using the same Sftp object for each transfer?
Reply | PowerTCP SFTP & SSH for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX