I need a little help with using multi-threading in my mini project the idea of the project is to send GET REQUEST To download multiple pages at the same time,
so for that we need to send multiple connections at the same time.
My current code is using only one thread to send the requests it send one request and then wait until the request is finished, then it send the next one..
Here's my base code:
Public Class Form1
Dim thread1 As System.Threading.Thread
Private sub sendReq()
Request.Method = "GET"
Request.UserAgent = "Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0"
Request.AllowAutoRedirect = True
Request.MaximumAutomaticRedirections = 9
Request.AllowWriteStreamBuffering = True
'Creating the responsder and Stream Reader
Dim Response As HttpWebResponse = Request.GetResponse
Dim ResponseStream As System.IO.Stream = Response.GetResponseStream
'Creating Another Stream Reader
Dim StreamReader As New System.IO.StreamReader(ResponseStream)
Dim Data As String = StreamReader.ReadToEnd
thread1 = New Thread(AddressOf Me.sendReq)
Please tell me that changes should i do, to send multiple connections