Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stack overflow problem -- Help needed

Status
Not open for further replies.

nomaam

Programmer
Dec 29, 2003
39
CA
Hello:

I am working with VB.NET in a windows form.

I am trying to write a program that loops through several FTP connections. Here is the snippet of code that I am having problems with:


--- Code: ---

Dim listRequest As FtpWebRequest 'FTP request
Dim listResponse As FtpWebResponse 'FTP response

'establishing connection and requesting response
listRequest = CType(WebRequest.Create(path), FtpWebRequest)
listRequest.Method = WebRequestMethods.Ftp.ListDirectoryDetails

listResponse = CType(listRequest.GetResponse(), FtpWebResponse) 'stack overflow exception is thrown on this line

--- End code ---

This code is looped through when each FTP connection is established. The code works well until about the 1900th loop then i get a stack overflow error thrown.

My question is why am I getting a stack overflow error? I don't see how a stack overflow can occur with the above code.

Exact error message: "An unhandled exception of type 'System.StackOverflowException' occurred in System.dll"

Any help would be appreciated.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top