CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2015
    Posts
    2

    vb.net send multiple connections at the same time

    Code:
    Public Class Form1
    
        Dim thread1 As System.Threading.Thread
    
    Private sub sendReq()
                'Header Options
                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.Headers.Add("pragma", "no-cache")
                Request.Headers.Add("Accept-Encoding", "gzip,deflate,sdch")
                Request.Headers.Add("cache-control", "no-cache")
                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
    
                StreamReader.Close()
                Response.Close()
    
    ...etc
    End Sub
    
    
    thread1 = New Thread(AddressOf Me.sendReq)
    thread1.Start()
    Please tell me that changes should i do, to send multiple connections

  2. #2
    Join Date
    Apr 2012
    Posts
    43

    Re: vb.net send multiple connections at the same time

    You can use that code and some simple multi-threading to achieve this.

  3. #3
    Join Date
    Apr 2015
    Posts
    2

    Re: vb.net send multiple connections at the same time

    Quote Originally Posted by Niya View Post
    You can use that code and some simple multi-threading to achieve this.
    Hi Niya,
    Thank you for your replay, could you please give me some hints, maybe some codes , how to achieve that

  4. #4
    Join Date
    Apr 2012
    Posts
    43

    Re: vb.net send multiple connections at the same time

    You mean you don't know how to use threads and you have a Thread object created in your code ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured