Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

too many calls? multithreaded app

$
0
0
i have an application that downloads lots of images at the same time..... to do this i create a seperate thread for each image i want to download. each thread calls the following procedure (public procedure in a module)



Dim theRequest As System.Net.WebRequest = System.Net.WebRequest.Create(url)
Dim theResponse As System.Net.WebResponse = theRequest.GetResponse()
Dim theImage As System.Drawing.Image = System.Drawing.Image.FromStream(theResponse.GetResponseStream())


sometimes it will lock the application up and it will fail on therequest.GetResponse

System.AccessViolationException was unhandled
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.


so i went back and made the app only download 1 image at a time and it works just fine

why can't i call this 5 or 10 times at the same time.. in different threads?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>