Me baje de PSCode un Bouncer Multiconexiones pero CREO que solo acepta 10 conexiones, y no tengo cojones de hacer que acepte mas, siempre que lo intento la cago xD
El que me baje es este:
http://www.pscode.com/vb/scripts/ShowCode.asp?txtCodeId=39020&lngWId=1
Si teneis alguno mejor que acepte MULTICONEXIONES si sois tan amables de pasarmelo, o echarme una mano con este xD
Os pongo el codigo:
Código:
Private Sub Command1_Click()
For a = 1 To 10
sckTCP(a).Close
sckTCP2(a).Close
DoEvents
Next a
sckTCP(0).Close
sckTCP(0).LocalPort = Text1
sckTCP(0).Listen
Timer1.Interval = Text4
End Sub
Private Sub Form_Load()
For a = 1 To 10
Load sckTCP(a)
Load sckTCP2(a)
DoEvents
Next a
Text4 = "10000"
'Form2.Show
End Sub
Private Sub sckTCP_ConnectionRequest(Index As Integer, ByVal requestID As Long)
On Error Resume Next
sckTCP(0).Close
For a = 1 To 10
If sckTCP(a).State = 0 Then
sckTCP2(a).Close
sckTCP2(a).RemoteHost = Text2
sckTCP2(a).RemotePort = Text3
sckTCP2(a).Connect
sckTCP(a).Accept requestID
DoEvents
a = 11
End If
DoEvents
Next a
sckTCP(0).Close
sckTCP(0).Listen
End Sub
Private Sub sckTCP_DataArrival(Index As Integer, ByVal bytesTotal As Long)
If temp = "" Then sckTCP(Index).GetData temp
DoEvents
Do
If sckTCP2(Index).State = 7 Then
sckTCP2(Index).SendData temp
DoEvents
temp = ""
Exit Do
End If
If sckTCP(Index).State = 0 Then Exit Do
DoEvents
Loop
End Sub
Private Sub sckTCP2_DataArrival(Index As Integer, ByVal bytesTotal As Long)
If temp = "" Then sckTCP2(Index).GetData temp
DoEvents
Do
If sckTCP(Index).State = 7 Then
sckTCP(Index).SendData temp
DoEvents
temp = ""
Exit Do
End If
If sckTCP(Index).State = 0 Then Exit Do
DoEvents
Loop
End Sub
Private Sub Timer1_Timer()
For a = 1 To 10
If sckTCP(a).State = 8 Then sckTCP(a).Close: sckTCP2(a).Close
If sckTCP(a).State = 9 Then sckTCP(a).Close: sckTCP2(a).Close
If sckTCP2(a).State = 8 Then sckTCP2(a).Close: sckTCP(a).Close
If sckTCP2(a).State = 9 Then sckTCP2(a).Close: sckTCP(a).Close
DoEvents
Next a
End Sub
Saludos y gracias ^^