I am currently porting a self-written network application from C++ to Ruby. This network application often needs to manage around 10.000 sockets at the same time, that means it needs quick access to any sockets that have readable data available, incoming connections, etc.
I have already experienced while writing it in C++, that select()
does not work for this case, because internally it uses 32 DWORD
s (128 byte) to manage maximally 1024 sockets with bitmasks. Since I sometimes have to work with more than 10.000 sockets, this function did not suffice. Thus I had to switch to poll()
which also made the code more elegant because I did not always have add and remove all the file-descriptors again.
As I can see from the Ruby documentation, Ruby offers IO.select()
, which would basically be a wrapper for the C-API (as far as I know). Unfortunately it seems like there is no IO.poll()
, which I would need for this particular application.
Does IO.select()
have the same limitations as select()
on WinSocks and Berkeley Sockets? If yes, is there a way to work around that?