Results 1 to 4 of 4

Thread: winsock

  1. #1
    nirmal2k
    Guest

    Question winsock

    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

  2. #2
    Lively Member
    Join Date
    Jul 2000
    Posts
    82
    try loopin -1 the last one,
    please explain the question better...

  3. #3
    Hyperactive Member Eyes.Only's Avatar
    Join Date
    Oct 2001
    Location
    Minnesota
    Posts
    347
    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...

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    Like this:

    VB Code:
    1. Dim A As Integer
    2. For A = 1 To wskServer.Count - 1
    3.    If wskServer(A).State = sckConnected Then: wskServer(A).SendData SndStr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width