NetworkStream crisis!!!

carlos_rocha

New member
Joined
Dec 7, 2004
Messages
1
Programming Experience
3-5
Hi!
I'm having a problem that is driving me crazy!I made a tcp server and client and when i exchange data between them, at the client the stream seems to overlap the following data to the previous ones.For example, if i write to the client "Hello client" the first time, and then write "hi" the reader gets "hillo client".When i use the server with telnet, the telnet shell receives the data correctly so i think the problem may be in the client(?).I cannot solve this problem, Can anyone help me pleaaaaaaase.I bet it's something stupid...

Dim bytes(tcpClient.ReceiveBufferSize) As Byte
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
Dim returndata As String = Encoding.ASCII.GetString(bytes)
Console.WriteLine(("Server returned: " + returndata))
networkStream.Read(bytes, 0, CInt(tcpClient.ReceiveBufferSize))
returndata = Encoding.ASCII.GetString(bytes)
Console.Write(returndata)
 
Back
Top