Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The underlying connection was closed
Message
From
10/07/2010 03:08:27
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
The underlying connection was closed
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01472129
Message ID:
01472129
Views:
83
I am using loFtpWebRequest to download a file from a server. Yesterday, I had to adjust the method to support big files such as 2.2 GB. The download works but will fail after 2 hours giving this message:

The underlying connection was closed: An unexpected error occured on a receive.

This happens when the download is at about 55%.

This is a portion of the code which demonstrates the object used for the download:
                ' FTP setup
                loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI))
                loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword)
                loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.DownloadFile
                loFtpWebRequest.UseBinary = True
                loFtpWebRequest.UsePassive = True

                loFtpWebResponse = loFtpWebRequest.GetResponse()

                loStream = loFtpWebResponse.GetResponseStream()
I am not sure if this could be related since I changed the mode to UsePassive=True yesterday.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Next
Reply
Map
View

Click here to load this message in the networking platform