I am using the following code to connect to my FTP server
FTPClient ftp;
ftp = new FTPClient();
ftp.RemoteHost=mHostName; //Host Name to connect to
ftp.ControlPort = mPort; //Port to Connect on
ftp.Timeout =mTimeOut; //TimeOut Value
ftp.ConnectMode = mConnectMode ; //PASV
ftp.Connect();
ftp.Login(mUserName, mUserPassword);
Immediately after Connect, trying to Login gives me "Unable to read data from the transport connection." But if I try to run the same code again, it lets me login perfectly (maybe cos it has already established a connection).
Should there be a time lag between Connect and Login. Would putting a sleep help?? I am not sure whats going on??
Thanks