• Welcome to Valhalla Legends Archive.
 

Winsock suggestions?

Started by TravelToAiur, October 17, 2003, 05:44 PM

Previous topic - Next topic

TravelToAiur

I'm making an app with several winsocks in it ( each one should be a separate bot that connects to b.net server ). When the first one connects all work fine, when the second asks for connection he get refused and the first winsock connection is closed as well.
Any suggestion?

PS: vb plz ;)

Spht

Quote from: TravelToAiur on October 17, 2003, 05:44 PM
I'm making an app with several winsocks in it ( each one should be a separate bot that connects to b.net server ). When the first one connects all work fine, when the second asks for connection he get refused and the first winsock connection is closed as well.
Any suggestion?

PS: vb plz ;)

No suggestions. Is this Visual Basic and are you using the Winsock control? You'll have to paste some related code.

TravelToAiur

#2
This is meant to be a really basic bot

Private Sub wskBNet_Connect()
   wskBnet.SendData Chr(3) & Chr(4) & BotAccount & vbCrLf & BotPass & vbCrLf
End Sub

Private Sub wskBNet2_Connect()
   wskBnet2.SendData Chr(3) & Chr(4) & BotAccount2 & vbCrLf & BotPass & vbCrLf
End Sub

Private Sub Form_Load()
   wskBnet.RemoteHost = server
   wskBnet.RemotePort = botPort
   wskBnet.Connect
--> all work fine, data is sent and bot appears online on b.net server
   wskBnet2.RemoteHost = server
   wskBnet2.RemotePort = botPort
   wskBnet2.Connect
--> connection is refused, wskBnet is disconnected as well :(
End Sub


[Edit: added code tags.  In the future, you should use them  yourself.]

hismajesty

#3
Please put (code) and (/code) around your code.

(replace ( and ) with [ and ] )

Banana fanna fo fanna

You can only have 1 connection to CHAT per IP address.

TravelToAiur

Any way to have more than one?
Use proxies on my app?
Or trying to spoof IP every new connection? Is this possibile in vb?
Thank you

Bannable

There is a simiple solution to this.  For each connection you have to increase the Local Port on each winsock so that it does not match any other local port's already in use.  If this is not done, odd things can happen.

CupHead

First of all, Bannable has no idea what he's talking about.

Secondly, yes, you can use a proxied connection to open more than one connection via CHAT.  Spoofing the IP wouldn't do any good because the connection negotiation would be attempted at the IP that you specified, not yours.  Other than that, you're stuck using a "binary" connection if you want more than one custom-client on [each gateway].

Lenny

Wouldnt a control array of winsocks be easier?
The Bovine Revolution
Something unimportant

Live Battle.net:

WARNING: The preceding message may have contained content unsuitable for young children.