Multi-socket - WeOnlyDo Discussion board

Multi-socket (wodWebServer / wodWebServer.NET)

by Celtik, Tuesday, July 15, 2008, 23:58 (5766 days ago)

OK, I am trying to multi-socket , and I am having some problems. With the code I am currently using, it only visits the website the same amount of times as the socket is loaded. For example when I use this code:

[code]For X = 0 To 25[/code]

it will only visit the site 25 times

What I am trying to do is make it keep loading/unloading , or whatever it is supposed to do and keep doing the events until it reaches txtViews.text I can't do for 1=txtViews.text because that will cause an overflow error easily.

Here is my full code:

Command:

[code]On Error Resume Next
Dim strsplit() As String
Dim usernames(999) As String
Dim passwords(999) As String
Dim X As Integer


For X = 0 To 25
Load HTTP(X)
HTTP(X).Disconnect
HTTP(X).Request.UserAgent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
HTTP(X).Request.Accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP(X).Get txtURL.Text
Pause txtPause.Text
Next X

If List1.ListCount <> 0 Then
For i = 0 To List1.ListCount - 1
List1.ListIndex = i

lblProxy.Caption = blah

strsplit() = Split(List1.List(i), : )
usernames(i) = strsplit(0)
passwords(i) = strsplit(1)

For X = 1 To txtSockets.Text
HTTP(X).Request.UserAgent = Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.2) Gecko/20070219 Firefox/2.0.0.2
HTTP(X).Request.Accept = text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
HTTP(X).ProxyHostname = strsplit(0)
HTTP(X).ProxyPort = strsplit(1)
HTTP(X).Timeout = txtTimeout.Text
HTTP(X).Get txtURL.Text
Pause txtPause.Text
Next X
Next i
End If
End If
[/code]
Here is the data arrival:

[code]Private Sub HTTP_Done(index As Integer, ByVal ErrorCode As Long, ByVal ErrorText As String)
Dim sresults(100)

Dim oldcookie(100) As HttpCookie
For Each oldcookie(index) In HTTP(index).Response.Cookies
HTTP(index).Request.Cookies.Add oldcookie(index).Name, oldcookie(index).Value
Next

If ErrorCode <> 0 Then
HTTP(index).Abort
HTTP(index).Disconnect
ElseIf ErrorCode = 0 Then
sresults(index) = HTTP(index).Response.Body
lblViews.Caption = lblViews.Caption + 1
HTTP(index).Disconnect
End If
End Sub
[/code]
I am using WodHTTP which is a winsock wrapper, but that should not affect anything..Please help me in anyway you can, I know the code can be tweaked way better than this.


Complete thread: