how to send messages to different clients on a winsock array with different ports. I tried looping with sckconnected but it sends message to the lat one in the loop
Printable View
how to send messages to different clients on a winsock array with different ports. I tried looping with sckconnected but it sends message to the lat one in the loop
try loopin -1 the last one,
please explain the question better...
you mean like this?...
Dim i As Integer
For i = 1 To wskServer.UBound 'loop through all loaded
If wskServer(i).State = 7 Then 'If this sock is connected
wskServer(i).SendData SndStr 'Then send the string thru
End If
Next
I wasnt using element 0 but if you were then
0 To wskServer.UBound would work instead...
Like this:
VB Code:
Dim A As Integer For A = 1 To wskServer.Count - 1 If wskServer(A).State = sckConnected Then: wskServer(A).SendData SndStr