FTP connection closing problem

B

B. Chernick

I've got a VB/Dot Net 2.0 Winforms app that connects to an FTP server and
uploads a file. I have very little experience writing FTP-related code.

In the simplest sense, once you've uploaded a file, what guarantees that an
FTP connection is completely closed?

I ask this because after I complete the upload and close all the objects
involved (the stream, the FTPWebResponse, the FTPWebRequest) I am unable to
list a different directory in the same FTP Server using unrelated code in a
different form. 'The Server returned an error: (550) File unavailable.'
 
K

kimiraikkonen

I've got a VB/Dot Net 2.0 Winforms app that connects to an FTP server and
uploads a file.  I have very little experience writing FTP-related code..

In the simplest sense, once you've uploaded a file, what guarantees that an
FTP connection is completely closed?  

I ask this because after I complete the upload and close all the objects
involved (the stream, the FTPWebResponse, the FTPWebRequest) I am unable to
list a different directory in the same FTP Server using unrelated code ina
different form.  'The Server returned an error: (550) File unavailable.'

Look at Close method:
http://msdn.microsoft.com/en-us/library/system.net.ftpwebresponse.close.aspx

After you call Close method, if no exception occurs, it may mean that
the closing is successful.
And pay attention that this method is useful when KeepAlive property
is set to False.

And as you're describing you have closed it, isn't it normal not to
reach the already closed connection?...

HTH,

Onur Guzel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top