-
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 ??
-
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