We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

FTP-Transfer fails

Dear experts,

I have a strange situation. We installed a FTP Server with several accounts on it. Every client is using exact the same version of the Aspose.Network component and tries to download messages after a specific amount of time (check if there are new messages, zip-Files) with exact the same code.

So far so good, everything is working like it should except for one client. He has problems to transfer some files. But the annoying thing is, that the error does not happen constantly. All is working fine till a "special" message arrives and the library is throwing the following error:

---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at Aspose.Network.Ftp.FtpClient.x5dfa1f60a4c6405f.xc5abe82d115f9b3e(Stream x08414f6582e09cd6, xce35b386c226c822 xe2b23cef8facc460)
--- End of inner exception stack trace ---

Copying this file manually solves then the problem, after that other files waiting to transfer can then be downloaded. So it's definetly not a network/firewall problem. Any suggestions?

Using Aspose.Network 4.8.0.5...

Best regards,
Ivan

PS: Here's my code:

FtpClient ftpClient = null;

try
{
ftpClient = Connect();
if (ftpClient == null) return;
if (!ftpClient.Exists(strRemoteFilePath)) throw new FileNotFoundException();
ftpClient.Download(strRemoteFilePath, strLocalFilePath, true);
if (bDeleteRemoteFile && File.Exists(strLocalFilePath)) ftpClient.Delete(strRemoteFilePath);
}

finally
{
Disconnect(ftpClient);
}

Hi,


I am sorry, I could not reproduce the problem at my end by trying to run multiple instances of application at same time, to download a file from same FTP server.

Could you please tell more details about that “special” message, after which the problem occurs?

After a few more tests, it seems that the error message only occurs when a client is trying to download "big" messages (>2MB)...

Could it be possible that the error follows from a specific setting I've made (for example CommandReceiveTimeout or Encoding)?

So far I only set these values when creating the connection;

ftpClient.DataReceiveTimeout = 7000;
ftpClient.DataSendTimeout = 7000;

Please help, the problem still exists...

Found a similiar unsolved Problem:
<A href="https://forum.aspose.com/t/43088</A></P> <P>Working with 4.8.0.5</P> <P>Thanks<BR>Ivan</P>

Hi Ivan,


I am sorry I could not find out the problem with the latest version. Is it possible for you to provide a test account for us?

Hi,

sorry there's no possiblity for a test account... But the problem seemed to be solved if I set the Upload and Connection Timeout to 120 seconds.. What's the default value? Is this just a side-effect?

Thanks
Ivan

Hi Ivan,


Setting the timeout to a higher value should not have this effect. The default values in milliseconds are:

<span style=“font-size:12.0pt;font-family:“Times New Roman”,“serif”;
mso-fareast-font-family:“Times New Roman”;color:black;mso-ansi-language:EN-US;
mso-fareast-language:EN-US;mso-bidi-language:AR-SA”>CommandReceiveTimeout =
51200

CommandSendTimeout = 51200

DataReceiveTimeout = 60000

DataSendTimeout = 60000