Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.1k views
in .NET FTP by (160 points)
Hi,

I'm currently using the EDTFTPCF version for a small Pocket PC application using Visual Basic.

Most of the time the tasks I carry out are ok and there aren't any problems. But then there are odd occasions when it crashes, and errors are reported such as "Control channel closed unexpectedly" or it's refusing to connect.

Are these problems that I have control over, or are they problems with FTP connection that I am unable to fix?

Thanks,

Kevin

3 Answers

0 votes
by (162k points)
How reliable is your connection to the server? If it is intermittent at times that will certainly affect things.

The next release of edtFTPnet/Compact will have a retry facility that silently retries transfers when these kind of errors occur on data transfers.
0 votes
by (160 points)
I'm using Visual Basic/your software in conjunction with another program entirely(built using Clarion).

Sending a file using FTP with the other program I use (Clarion) is never a problem, so I don't think it's a server error.

It sometimes has problems with the FTP.close() method (this is the "Control channel closed unexpectedly" error) even though prior to this I check that it's still connected.
0 votes
by (162k points)
That most likely means the server has disconnected you, so the control channel has been closed.

Use this:

try
{
ftp.Close();
}
catch (Exception)
{
ftp.Close(true);
}

The first Close sends a QUIT message which won't work if the connection has already been closed. The second Close forces the connection to be closed. Unfortunately IsConnected isn't that reliable - you can't tell in TCP whether the server has silently gone away.

Categories

...