All I want is to read from multiple sockets (less than 10) at the same time. No matter which socket has something to read, I'll read and warp the data into a message and put that message into a queue.
It's easy to do so with, for example, select()
. I can just add those sockets (less than 10) to a FD_SET
and select()
on that set. How can I do that in C#? The simpler the solution is, the better.
As pointed out by ja_mesa you are looking for the Socket.Select Method.
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