Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: REiGN on March 24, 2003, 04:58 PM

Title: More winsock connections.
Post by: REiGN on March 24, 2003, 04:58 PM
Ok say when I get disconnected from battle.net. How would I make more winsocks trying to connect, since im only using one I get around 1 reconnect per second, Im thinking more like 6 per second. This is how it looks right now.


Private Sub Winsock_Close()
   AddChat "Server closed connection" & vbCrLf, vbRed
   Battlenet.Disconnect Winsock
   Winsock.Connect
End Sub
Title: Re:More winsock connections.
Post by: n00blar on March 24, 2003, 09:53 PM
I'm not understanding you to well but let me _try_ to help you...


Private Sub SocketName_Close()
   SocketName.Close
   SocketName.Connect 'assuming all properties required set
End Sub
Title: Re:More winsock connections.
Post by: REiGN on March 25, 2003, 02:44 PM
Like I would want 5 winsocks trying to connect to battle.net at the same time.
Title: Re:More winsock connections.
Post by: n00blar on March 25, 2003, 03:57 PM
I am not quite sure *why* you would want to do that but there are a couple ways you could do that

1: Add five winsock controls to the form

Private Sub Form_Load()
   'set properties
   SocketName1.Connect
   SocketName2.Connect
   SocketName3.Connect
   SocketName4.Connect
   SocketName5.Connect
End Sub


2: Add one winsock control, goto ites properties, and set an index value

Private Sub Form_Load()
    Dim i as Integer
    For i = (Index Value you set) + 1 to (Index Value you set) + 4
        Load SocketName(i)
        'set properties
        SocketName(i).Connect
    Next i
End Sub
Title: Re:More winsock connections.
Post by: REiGN on March 26, 2003, 12:55 AM
So for the frist one would it look like:
Private Sub Winsock_Close()
   AddChat "Server closed connection" & vbCrLf, vbRed
   Battlenet.Disconnect Winsock
   Winsock1.Connect
   Winsock2.Connect
   Winsock3.Connect
   Winsock4.Connect
End Sub








Quote from: n00blar link=board=17;threadid=809;start=0#msg6395
date=1048629452

I am not quite sure *why* you would want to do that but there are a couple ways you could do that

1: Add five winsock controls to the form

Private Sub Form_Load()
   'set properties
   SocketName1.Connect
   SocketName2.Connect
   SocketName3.Connect
   SocketName4.Connect
   SocketName5.Connect
End Sub


2: Add one winsock control, goto ites properties, and set an index value

Private Sub Form_Load()
    Dim i as Integer
    For i = (Index Value you set) + 1 to (Index Value you set) + 4
        Load SocketName(i)
        'set properties
        SocketName(i).Connect
    Next i
End Sub

Quote
Title: Re:More winsock connections.
Post by: z0rg on March 26, 2003, 02:55 AM
y0 REIGN this is {EwR}ZeRG^KoG .. IM me.. ill help u out...    

AIM: eheads15
Title: Re:More winsock connections.
Post by: Atom on March 27, 2003, 06:33 PM
This is a terrible idea. If your having problems reconnecting fast adding more sockets is gonna add to the problem. Not to mention you will have 6 winsocks that will end up connecting. It will probably also end up with an ip ban. I really wouldnt reccomend that.
Title: Re:More winsock connections.
Post by: Banana fanna fo fanna on March 27, 2003, 06:34 PM
Reign: what exactly are you trying to do?
Title: Re:More winsock connections.
Post by: Sevatox on March 28, 2003, 02:34 AM
Hes trying to make a massload, super reconnect bot for xgn (zorm's warrnet server) :\

EDIT: forgot to mention, you can't get ipbanned unless zorm, avenger, or slash  ibpan you
Title: Re:More winsock connections.
Post by: Skywing on March 28, 2003, 11:53 PM
Quote from: St0rm.iD on March 27, 2003, 06:34 PM
Reign: what exactly are you trying to do?
I'll take a stab in the dark and guess he's trying to reestablish a lost connection faster when the remote host has gone down for a reboot.  For whatever reason, I'm guessing he doesn't want to wait around for the TCP SYN messages to be timed out and presumed lost by the OS before it returns failure for a connect event.

A better solution might be to offset each connect attempt by say 250ms, and if all connect attempts are in progress after 250ms more rolls around, cancel the oldest request.  Naturally, this will make it impossible to connect if your latency to the server is around 1500ms or higher, but I'm also guessing the author isn't too concerned about that.