Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
7.6k views
in .NET FTP by
When downloading a file of over 200mb the file downloads OK but the ftp claases freeze on the validate() function.

Seems the line read doesn't work.

any ides???????

8 Answers

0 votes
by (162k points)
You'll need to post a log file ...

When downloading a file of over 200mb the file downloads OK but the ftp claases freeze on the validate() function.

Seems the line read doesn't work.

any ides???????
0 votes
by
Here's an extract of the log file
last line is where it freezes.
As I said in post 1
the program seems to freeze on this call:

public virtual void Get(string localPath, string remoteFile)
{
// get according to set type
if (transferType == FTPTransferType.ASCII)
{
GetASCII(localPath, remoteFile);
}
else
{
GetBinary(localPath, remoteFile);
}

ValidateTransfer();

Where the validate transfer calls the:

internal virtual FTPReply ReadReply()
{
string line = reader.ReadLine();
if (line == null || line.Length == 0)
throw new SystemException("Unexpected null reply received");


seems that the reader.ReadLine call gets messed up ????????

Any idea???



-- Log File exract:

2005-03-09 20:14:26: ftp 331 User name OK, need password.
2005-03-09 20:14:26: ftp ---> PASS ********
2005-03-09 20:14:26: ftp 230 User logged in.
2005-03-09 20:14:26: ftp ---> TYPE I
2005-03-09 20:14:26: ftp 200 Using binary mode to transfer files.
2005-03-09 20:14:26: ftp ---> CWD /demo/media
2005-03-09 20:14:26: ftp 250 CWD OK, "/demo/media".
2005-03-09 20:14:26: ftp ---> PASV
2005-03-09 20:14:26: ftp 227 Entering Passive Mode
2005-03-09 20:14:26: ftp ---> RETR bigTestFile..mpg
2005-03-09 20:14:26: ftp 150 Transfer starting.
2005-03-09 20:14:26: *--> ftp transfer started.
0 votes
by (162k points)
How long does the download take? You can use a progress monitor to log its progress.


Here's an extract of the log file
last line is where it freezes.

-- Log File exract:

2005-03-09 20:14:26: ftp 331 User name OK, need password.
2005-03-09 20:14:26: ftp ---> PASS ********
2005-03-09 20:14:26: ftp 230 User logged in.
2005-03-09 20:14:26: ftp ---> TYPE I
2005-03-09 20:14:26: ftp 200 Using binary mode to transfer files.
2005-03-09 20:14:26: ftp ---> CWD /demo/media
2005-03-09 20:14:26: ftp 250 CWD OK, "/demo/media".
2005-03-09 20:14:26: ftp ---> PASV
2005-03-09 20:14:26: ftp 227 Entering Passive Mode
2005-03-09 20:14:26: ftp ---> RETR bigTestFile..mpg
2005-03-09 20:14:26: ftp 150 Transfer starting.
2005-03-09 20:14:26: *--> ftp transfer started.
0 votes
by
transfer takes 25mins before the program freezes.

Tested using a comercial FTP progam, it took the same time.
0 votes
by (162k points)
Using a command line FTP program, type 'debug' and perform the same operations, then post the output.

transfer takes 25mins before the program freezes.

Tested using a comercial FTP progam, it took the same time.
0 votes
by
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

ftp> o ****** (removed)
Connected to ftp.johner.se.
220 FTP server ready.
User ******** (removed): ******** (removed)
---> USER eyecatchtv
331 User name OK, need password.
Password:
---> PASS ectv
230 User logged in.
ftp> dir
---> PORT ******** (removed)
200 PORT OK, IP address ******** (removed)port 60010
---> LIST
150 Opening data connection.
drwxrwxrwx 0 owner group 4 Feb 24 20:02 demo
-rwxrwxrwx 0 owner group 4964358 Oct 24 2001 ima05950.jpg
-rwxrwxrwx 0 owner group 16205191 Oct 27 14:34 ima07115.jpg
-rwxrwxrwx 0 owner group 32158158 Jul 04 2003 ima11074.jpg
-rwxrwxrwx 0 owner group 32234368 Jul 04 2003 ima11074.jpg
-rwxrwxrwx 0 owner group 20331258 Nov 15 16:43 ima26737.jpg
drwxrwxrwx 0 owner group 13 Mar 09 11:29 kund_loggor
226 Transfer complete.
ftp: 510 bytes received in 0,06Seconds 8,23Kbytes/sec.
ftp> cd demo
---> CWD demo
250 CWD OK, "/demo".
ftp> cd media
---> CWD media
250 CWD OK, "/demo/media".
ftp> dir
---> PORT ******** (removed)
200 PORT OK, IP address ******** (removed)port 60011
---> LIST
150 Opening data connection.
-rwxrwxrwx 0 owner group 213866496 Mar 07 09:55 ateens-floorfiller.mpg
-rwxrwxrwx 0 owner group 336261120 Mar 08 16:51 eminem-momma.mpg
-rwxrwxrwx 0 owner group 229832704 Mar 07 15:10 faithhill.mpg
drwxrwxrwx 0 owner group 9 Feb 24 20:11 images
-rwxrwxrwx 0 owner group 279771136 Mar 07 16:12 jlofeat-christmas.mpg
-rwxrwxrwx 0 owner group 429 Feb 24 20:10 kvallensdrink.html
-rwxrwxrwx 0 owner group 6207 Feb 24 20:10 logga-139x76-transparent.gif
-rwxrwxrwx 0 owner group 1289 Mar 02 15:57 playlist.xml
-rwxrwxrwx 0 owner group 428 Feb 24 20:10 s-brunch-273.html
-rwxrwxrwx 0 owner group 424 Feb 24 20:10 s-brunch.html
-rwxrwxrwx 0 owner group 430 Feb 24 20:10 s-jlinberg-273.html
-rwxrwxrwx 0 owner group 426 Feb 24 20:10 s-jlinberg.html
-rwxrwxrwx 0 owner group 79181 Feb 24 20:10 s-kvallens-273.jpg
-rwxrwxrwx 0 owner group 418 Feb 24 20:10 s-porche.html
-rwxrwxrwx 0 owner group 105924612 Mar 02 15:13 Showreel.mpg
-rwxrwxrwx 0 owner group 103395332 Mar 02 15:56 Sport.mpg
-rwxrwxrwx 0 owner group 162416640 Mar 07 09:06 stockholm.mpg
-rwxrwxrwx 0 owner group 67613 Feb 24 20:10 t-aftonbladet-vader-1365.jpg
-rwxrwxrwx 0 owner group 426 Feb 24 20:10 t-aftonbladvader.html
-rwxrwxrwx 0 owner group 40995 Feb 24 20:10 t-expect-odd-1365.jpg
-rwxrwxrwx 0 owner group 418 Feb 24 20:10 t-expect.html
-rwxrwxrwx 0 owner group 421 Feb 24 20:10 t-hantextra.html
-rwxrwxrwx 0 owner group 65884 Feb 24 20:10 t-porche.jpg
226 Transfer complete.
ftp: 1602 bytes received in 0,34Seconds 4,66Kbytes/sec.
ftp> get faithhill.mpg
---> PORT 192,168,0,100,17,135
200 PORT OK, IP address ******** (removed) port 60012
---> RETR faithhill.mpg
150 Opening data connection (224446k)
226 RETR complete.
ftp: 231152296 bytes received in 1931,38Seconds 119,68Kbytes/sec.
ftp>




And here is more trace from my App:
I put some debugging log lines in the FTPClient_cs file and
FTPReply.cs file

It seems to hang as soon as it reaches the
ReadReply() function

by the way it's an UNIX WebSTAR FTP server. Not sure which version!


2005-03-09 23:47:15: ...FTPClient_cs: returning:CWD OK, "/demo/media".
2005-03-09 23:47:15: .... FTPClient_cs: Get C:\Program Files\SuSMediaDisplay\SuSFTPAgent\download\tmpFile00401.file ... faithhill.mpg
2005-03-09 23:47:15: ...FTPClient_cs: Entered CheckConnection( param:True)
2005-03-09 23:47:15: ---> PASV
2005-03-09 23:47:15: ftp ---> PASV
2005-03-09 23:47:15: ...FTPClient_cs: Entered FTPReply ReadReply()
2005-03-09 23:47:15: 227 Entering Passive Mode (80,252,167,126,197,129).
2005-03-09 23:47:15: ftp 227 Entering Passive Mode (80,252,167,126,197,129).
2005-03-09 23:47:15: ...FTPClient_cs: returning:Entering Passive Mode (80,252,167,126,197,129).
2005-03-09 23:47:15: ---> RETR faithhill.mpg
2005-03-09 23:47:15: ftp ---> RETR faithhill.mpg
2005-03-09 23:47:15: ...FTPClient_cs: Entered FTPReply ReadReply()
2005-03-09 23:47:15: 150 Transfer starting.
2005-03-09 23:47:15: ftp 150 Transfer starting.
2005-03-09 23:47:16: ...FTPClient_cs: returning:Transfer starting.
2005-03-09 23:47:16: *--> ftp transfer started.
2005-03-10 00:19:12: *--> ftp transfer complete.
2005-03-10 00:19:13: Transferred 229832704 bytes from remote host
2005-03-10 00:19:13: ...FTPClient_cs: Entered ValidateTransfer()
2005-03-10 00:19:13: ...FTPClient_cs: Entered CheckConnection( param:True)
2005-03-10 00:19:13: ...FTPClient_cs: Entered ValidateTransfer() calling control.ReadReply()
2005-03-10 00:19:13: ...FTPClient_cs: Entered FTPReply ReadReply()
0 votes
by (162k points)
One thing to try - transfer in active mode rather than passive mode - that's what the command line client is doing.
0 votes
by
Thanks for the help
making it an active transaction seems to have helped.

I'm still getting read errors but can now handle them better:

ewxamples:
2005-03-10 15:02:08: ...FTPClient_cs: Entered FTPReply ReadReply()
2005-03-10 15:02:09: ...FTPClient_cs: Entered FTPReply Exception at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamReader.ReadBuffer()
at System.IO.StreamReader.ReadLine()
at EnterpriseDT.Net.Ftp.FTPControlSocket.ReadReply()
2005-03-10 15:02:09: Caught in DoDownload: Error in readlineUnable to read data from the transport connection.
2005-03-10 15:02:09: Closing currently scheduled action!

ftp Error in closing Connection: System.IO.IOException: Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
at System.IO.StreamWriter.Flush(Boolean flushStream, Boolean flushEncoder)
at System.IO.StreamWriter.Flush()
at EnterpriseDT.Net.Ftp.FTPControlSocket.WriteCommand(String command)
at EnterpriseDT.Net.Ftp.FTPControlSocket.SendCommand(String command)
at EnterpriseDT.Net.Ftp.FTPClient.Quit()
at FTPAgent.Schedule.ExecuteActions()
2005-03-10 15:02:11: Completed actions.

Categories

...