Problems with winsock in vb

Discussion in 'OT Technology' started by cactusnwo, Mar 2, 2004.

  1. cactusnwo

    cactusnwo Guest

    I have the following piece of code:

    If sock.State <> 0 Then sock.Close
    sock.RemoteHost = compname
    sock.RemotePort = 80
    sock.Connect
    While sock.State = 6
    DoEvents
    Wend
    If sock.State = 7 Then
    sock.SendData message
    sock.Close
    Else
    MsgBox "Error"
    'error connecting to client
    End If

    I get my error message box every time i run it. The remote machine is in the connected state when i get this message, so they can communicate. Any ideas as to why this is happening and how i could fix it?

    Thanks.
     

Share This Page