Results 1 to 5 of 5

Thread: Winsock [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    UK
    Posts
    147

    Question Winsock [RESOLVED]

    I am trying to get to grips with winsock (I feel it is about time).

    I have create a client and put the connect, send and close commands behind different button click events and it works fine, but when i come to try to do it behind one click event no data is sent. I don’t get any errors but no data is sent to the server app.

    Any suggestions please.



    VB Code:
    1. Private Sub Command1_Click()
    2. Dim count As Integer
    3. Dim iData(1 To 4096) As Byte
    4. Dim J As Long
    5. Dim InputLength As Long
    6.  
    7. If winsock1.State <> sckClosed Then winsock1.Close
    8. winsock1.Connect
    9.  
    10. iData(1) = 1
    11. iData(2) = 4
    12. iData(3) = 0
    13. iData(4) = 4
    14. iData(5) = 0
    15. iData(6) = 2
    16. iData(7) = 48
    17. iData(8) = 10
    18.  
    19. Do Until winsock1.State = sckConnected
    20.     DoEvents: DoEvents: DoEvents: DoEvents
    21.     If winsock1.State = sckError Then
    22.         MsgBox "No connection"
    23.         Exit Sub
    24.     End If
    25. Loop
    26.  
    27. For J = 1 To 8
    28.     winsock1.SendData (iData(J))
    29. Next
    30.  
    31. winsock1.Close
    32. End Sub
    Last edited by mik706; Jun 18th, 2003 at 04:26 AM.
    Mik706

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