io ho fatto così:
client:
codice:
Private Sub Form_Load()
Winsock2.RemotePort = Text3.Text
Winsock2.Listen
End Sub
codice:
Private Sub Winsock2_ConnectionRequest(ByVal requestID As Long)
If Winsock2.State <> sckClosed Then Winsock2.Close
Winsock2.Accept requestID
End Sub
codice:
Private Sub Winsock2_DataArrival(ByVal bytesTotal As Long)
Dim dati2 As String
Winsock2.GetData dati2, vbString
Text1.Text = Text1.Text & dati2 & vbCrLf
End Sub
codice:
Private Sub Command4_Click()
Winsock2.Connect Client.Text, Text3.Text
End Sub