The example uses the GetData method in the DataArrival event of a Winsock control. When the event occurs, the code invokes the GetData method to retrieve the data and store it in a string variable. The data is then written into a TextBox control.
Private Sub Winsock1_DataArrival _
(ByVal bytesTotal As Long)
Dim strData As String
Winsock1.GetData strData, vbString
Text1.Text = Text1.Text & strData
End Sub