I create 2 simple applications from TcpClient and TcpListener classes, my purpose is to communicate between 2 application for data sharing.
My problem is that, when I send message from TcpClient to TcpListener, my TcpListener application will do some process and send the "completed" message back to TcpClient. So how do I received this message from TcpClient?
If I use above example, the "While Not Client.GetStream.DataAvailable()" process will make the server slow. I did tried to use Timer instead, but it seem to no working, about other ideas?
Thank you
My problem is that, when I send message from TcpClient to TcpListener, my TcpListener application will do some process and send the "completed" message back to TcpClient. So how do I received this message from TcpClient?
Visual Basic:
Dim Client As TcpClient
......
Client.GetStream().Write(Buffer, 0, Buffer.Length)
While Not Client.GetStream.DataAvailable()
Application.DoEvents()
End While
If Client.GetStream.DataAvailable() Then
......
End If
If I use above example, the "While Not Client.GetStream.DataAvailable()" process will make the server slow. I did tried to use Timer instead, but it seem to no working, about other ideas?
Thank you