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
The simplest way is probably to use an additional thread which reads synchronously and puts extra data onto an extra queue.
Alternatively you could use asynchronous IO, but that's somewhat tricky - and you'd still need to have some additional queue.
Although Socket
has a Select()
method (and you can get at a socket from a NetworkStream
) I don't believe it exposes this functionality in a way which lets you mix it with other kinds of wait handles.