Discuss (FTP), (FTP on .NET CF) and (FTPS, SFTP and SCP).
no avatar
User

linda

Posts

1

Joined

Tue Apr 26, 2005 4:09 am

System.Net.Sockets.SocketException:

by linda » Tue Apr 26, 2005 4:22 am

I am using edtftp as ftp client.
I can connect but when I try to list directory or get the file, an exception as following:
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.Connect(EndPoint remoteEP)
at EnterpriseDT.Net.StandardSocket.Connect(EndPoint remoteEP)
at EnterpriseDT.Net.Ftp.FTPControlSocket.NewPassiveDataSocket(String ipAddress, Int32 port)
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocketPASV()
at EnterpriseDT.Net.Ftp.FTPControlSocket.CreateDataSocket(FTPConnectMode connectMode)
at EnterpriseDT.Net.Ftp.FTPClient.Dir(String dirname, Boolean full)
at DiamondDBImporter.Ftp.GetFile(String localFileName, String remoteFileName

And here is my code:
ftp = new FTPClient(host);

// login
log.Debug("log in");
ftp.Login(user, password);
// set up passive ASCII transfers
log.Debug("Setting up passive, ASCII transfers");
ftp.ConnectMode = FTPConnectMode.PASV;
ftp.TransferType = FTPTransferType.ASCII;
// get directory and print it to console
log.Debug("Directory:");
string[] files = ftp.Dir(".", true);
for (int i = 0; i < files.Length; i++)
log.Debug(files[i]);
// copy file from server
log.Info("Getting file");
ftp.Get(localFileName, remoteFileName);
// Shut down client
log.Info("Quitting client");
ftp.Quit();
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: System.Net.Sockets.SocketException:

by support2 » Tue Apr 26, 2005 7:44 am


Who is online

Users browsing this forum: No registered users and 52 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign