views:

24

answers:

0

Related Question: http://stackoverflow.com/questions/1746342/networkstream-canread-true-but-buffer-returning-no-value

I want to recreate a TCP server that doesn't send any data on the network stream (or that's how it seems when the bytes are converted to string) but the NetworkStream object .CanRead property still remains true

If I don't send anything on the Network Stream for a while I get a IOException (on Read) but I don't want that. I am trying to recreate the problem I had in the above question and hence get to the cause.

-- Edit Actually the number of Bytes read on Read is 0 also int numberOfBytesRead = networkStream.Read(myReadBuffer, 0, myReadBuffer.Length);