Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the C# equivalent function of select/epoll/kqueue?

Tags:

c#

sockets

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.

like image 577
GuLearn Avatar asked Nov 13 '22 02:11

GuLearn


1 Answers

As pointed out by ja_mesa you are looking for the Socket.Select Method.

like image 168
NobodysNightmare Avatar answered Nov 15 '22 00:11

NobodysNightmare