469,963 Members | 1,774 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,963 developers. It's quick & easy.

FTPWebRequest - connection attempts are "flakey" - fails first call, then works

I have been trying to use an FTPWebRequest to upload a file to an FTP site.
Invariably, the first attempt will fail on the call to GetRequestStream,
with the error message "Unable to connect to the remote server". However,
subsequent attempts will succeed when attempted immediately thereafter.

If you let the application sit "idle" for a while, then the pattern will
repeat. The next request after the long idle period will fail, but
subsequent requests immediately thereafter will succeed.

I have seen this same pattern in the 9.0 version of the SQL Server
Replication Merge control (which has some .NET framework components). The
FTP attempt to download a snapshot usually fails to connect on the first
attempt with a similar message, but will succeed if you keep trying.

Anyone have any ideas? It occurs with different FTP sites, and I never have
any trouble connecting directly to the same FTP using Internet Explorer or
via command line FTP.
Oct 31 '06 #1
0 1346

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

13 posts views Thread by Adam | last post: by
55 posts views Thread by AnandaSim | last post: by
5 posts views Thread by andy | last post: by
4 posts views Thread by eeb4u | last post: by
3 posts views Thread by David | last post: by
1 post views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.