I want to implement a custom TCP Client in Unity that has separate threads for sending and receiving certain messages. For sending, the Client is supposed to have a blocking queue, that
- receives messages from other threads and
- the message-sending thread polls messages from the queue and sends them - but blocks when the queue is empty.
In on .net 3.5 I do not have access to BlockingCollection.
I would have expected that some implementation existed. So far I have found implementation that simply lock on a queue, which from my understanding is not sufficient.
How could I implement this?