I have a worker thread in my application that is responsible for three different things. Requests for two of the jobs turn up in Queues that I have written, the other job is
I discovered, that if you call NetworkStream.Read with size = 0, it will actually block:
NetworkStream.Read
size = 0
networkstream.Read(buffer, 0, 0);
The documentation is not clear about this, but for me it worked.