On a DIR command, the code currently expects to either
receive the responses right away or expects to receive
the 226 after the file list is read. However, some ftp
servers don't return the 226 until after the data
channel is closed. In this case, because the data
channel is closed after the message is read, an
erroneous error message about "ftp comment not received
from server" is generated. Moving the following code
in the Dir() method solves the problem:
networkStream = client.GetStream();
fileList = ReadLines(networkStream);
// these two lines were after the message read but
should be here
networkStream.Close();
client.Close();
Nobody/Anonymous ( nobody ) - 2006-09-18 17:29
5
Open
None
Nobody/Anonymous
Interface (example)
None
Public
|
Date: 2008-09-23 15:38 Hi, |
|
Date: 2006-10-10 00:43 Logged In: YES |