Results 1 to 3 of 3

Thread: winsock question..

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2002
    Location
    UK
    Posts
    11

    winsock question..

    hi i would like to know if there is any code to show that winsock is connected... i tried this as an example..

    Private Sub cmdwinsck_click()
    winsck.connect ("ip, port")
    If winsck.state = connected then
    Msgbox "Connected"
    else
    Msgbox "Didn't connect!"
    End If
    End Sub


    what is meant to happen is when winsock is connected a message box pops up saying you are connected ...

    am i correct in this code or totally wrong??
    please help.

    -----------------------------
    OS: RedHat Linux 8.0
    RAM: 255
    HDSPACE: 60 GiG
    SC: Sound Blaster
    VC: Hercules 3d 4000 xt
    Average Uptime: 98 hrs
    ------------------------------

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099
    try this

    VB Code:
    1. Winsock.Close
    2. Winsock.Connect "HOST", PORt
    3. Do Until Winsock.State = sckConnected
    4. DoEvents
    5. Loop
    6. MsgBox "connected"

  3. #3
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Earth
    Posts
    762

    Cool

    winsock has it's on event when it's connected

    private sub windock_connected()
    msgbox "connected......."
    end sub

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