title: c# NetworkStream write() and read()
body: <p>I'm wondering how to stop <code>Networkstream.Read()</code> from blocking thread. I have separate thread where <code>NetworkStream.Read()</code> is waiting for data from server. Assume that user press some button that send some data to server. But I can't call <code>NetworkStream.Write()</code> while there is <code>NetworkStream.Read()</code> in other thread waiting for data. I can lock <code>NetworkStream</code> each time but <code>NetworkStream.Read()</code> will block thread so I can't send data until read at least 1 byte.</p>