I'm wondering how to stop Networkstream.Read()
from blocking thread. I have separate thread where NetworkStream.Read()
is waiting for data from server. Assume that user press some button that send some data to server. But I can't call NetworkStream.Write()
while there is NetworkStream.Read()
in other thread waiting for data. I can lock NetworkStream
each time but NetworkStream.Read()
will block thread so I can't send data until read at least 1 byte.
C programming language is a machine-independent programming language that is mainly used to create many types of applications and operating systems such as Windows, and other complicated programs such as the Oracle database, Git, Python interpreter, and games and is considered a programming foundation in the process of ...
Full form of C is “COMPILE”. One thing which was missing in C language was further added to C++ that is 'the concept of CLASSES'.
C is a general-purpose language that most programmers learn before moving on to more complex languages. From Unix and Windows to Tic Tac Toe and Photoshop, several of the most commonly used applications today have been built on C. It is easy to learn because: A simple syntax with only 32 keywords.
You can issue both read
and write
simultaneously as stated in the docs at MSDN docs
Read and write operations can be performed simultaneously on an instance of the NetworkStream class without the need for synchronization. As long as there is one unique thread for the write operations and one unique thread for the read operations, there will be no cross-interference between read and write threads and no synchronization is required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With