Thank you for your answer
I will certainly have a look into SFNUL. And epoll() is interesting, however I'd rather use something which is higher level.
So far it looks like that on Linux the number of concurrent TCP sockets is only limited by number of ports. Of course the selector amount is limited and it seems like it's good idea not to use selector on big server.
So I want to ask if it is a good idea to handle many (about 10k) TCP sockets this way:
- I create 10k sockets, set each of them to non-blocking mode and store them in vector
- my server has infinite main loop, and inside it I do:
foreach(&socket : socketContainer)
{
if(socket.receive (...) == sf::SocketDone)
{
//handle received data here
}
}
As for CPU and bandwith performance, it should be no problem on my server so I don't ask about it. I want to know if it is proper to handle TCP sockets in such way, without using selector.