Winsock - Connection (array)
This amkes no sence to me but on the 2nd connection i get the "ivalid operation at current state" error which means the socket is in use,
VB Code:
Dim x As Long ' counter
If Winsock.UBound < 1 Then 'this is our first connection so accept it
Load Winsock(Winsock.UBound + 1)
Winsock(Winsock.UBound).Accept requestID
End If
For x = 1 To Winsock.UBound + 1 'loops through existing connections to amke sure we have none spare
If Winsock(x).State <> sckConnected Then
Winsock(x).Accept requestID '<<Error here!
Else
If x >= Winsock.UBound Then 'there si none spare so accept on new socket
Load Winsock(Winsock.UBound + 1)
Winsock(Winsock.UBound).Accept requestID
Exit Sub
End If
End If
Next x
i cant understand :( maybe its a simple error?
PINO
Re: Winsock - Connection (array)
hi,
I'm fairly new to Winsock, and i'm trying to make some simple chat software. I've been looking on google for various Winsock tutorials, but can't find any that are simple enough for a beginner, but also good enough to ensure that i actually learn what is trying to be taught...
If anybody knows a good tutorial, with examples, etc. Then please could you tell me the link.
Thanks & Regards,
Muthukumaramani.S
Note: This is for VB 6
Re: Winsock - Connection (array)
Very old thread you should really create a new one!
http://www.vbforums.com/showthread.php?t=297308
That should help thats as simple as you will get.
Good Luck