Im currently using this code to download binary data from about 2000 uri's. The code works fine, however, once it gets near the 600th request it starts to slow down considerably. Any help with optomizing my current method or a point towards a different one is greatly appreciated thanks.
Private Function getpiece(ByVal hash As String, ByVal piece As String)
Dim txturi As String = (removed)
Dim pieceuri As New Uri(txturi)
Dim piecerequest As System.Net.WebRequest = System.Net.WebRequest.Create(pieceuri)
Dim pieceresponse As System.Net.WebResponse = piecerequest.GetResponse()
' Get the stream containing content returned by the server.
Dim dataStream As Stream = pieceresponse.GetResponseStream()
' Open the stream using a StreamReader for easy access.
Dim reader As New System.IO.BinaryReader(dataStream)
' Read the content.
Dim responseFromServer() As Byte = reader.ReadBytes(264144)