how to write the code same like winsock dataarrival event?
and now i m using the stupid way to replace the dataarrival event..
it is use a timer and keep refreshing ,if any data receive then show it out..
got any idea to do like Winsock DataArrival Event?
here is my stupid way coding
and now i m using the stupid way to replace the dataarrival event..
it is use a timer and keep refreshing ,if any data receive then show it out..
got any idea to do like Winsock DataArrival Event?
here is my stupid way coding
VB.NET:
Private Sub CheckTcpListener(ByVal sender As Object, ByVal e As System.EventArgs)
' This method is called every second when _Timer is running.
If _ClientSocket.ReceiveBufferSize > 0 Then
Dim Data(_ClientSocket.ReceiveBufferSize) As Byte
_ClientSocket.Receive(Data)
ReceivedTextBox.Text = _ClientSocket.ReceiveBufferSize & vbCrLf
For i = 0 To _ClientSocket.ReceiveBufferSize - 1
ReceivedTextBox.Text = Data(i) & " "
Next
End If
End Sub