Results 1 to 2 of 2

Thread: WINSOCK ( WINSUCK )

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    208

    Angry

    I have 2 winsock on a form ..
    If the person have the password to unloack the application, he can send message :

    Code:
    Private Sub Command1_Click ()
       Winsock1.LocalPort=52
       Winsock1.connect "24.226.111.11", "51"
       Winsock1.SendData "YO !"
    End Sub
    For the sencond winsock , I put that in the f
    Code:
    Private Sub Form_load ()
       Winsock2.RemotePort=52
       Winsock2.LocalPort=51
       Winsock2.Listen
    End if
    So, I open the program,
    I click on the button and winsock won't send anything ..!

    WHY ?
    Can you give me a good code to send/get ASCII data in TCP/IP
    connection ??

  2. #2
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    Place this on the form/project that's listening (server)
    Code:
    Private Sub Form_Load()
    Winsock1.Close
    Winsock1.LocalPort = 136
    Winsock1.Listen
    End Sub
    
    Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
    If Winsock1.State <> sckClosed Then _
        Winsock1.Close
        Winsock1.Accept requestID
    End Sub
    
    Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
    Dim data As String
    Winsock1.GetData data, vbString
    txtchat.Text = txtchat.Text & ": " & data
    End Sub
    Just change the names of the textboxes to whatever you used.

    Gl,
    D!m
    Dim

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