I have a problem, i use boost::asio for my server listener implementation, but using boost::asio when count connected sockets > 1000-1100 i have an error - "Too many opened files"
How can i fix that?
Thanks!
I have a problem, i use boost::asio for my server listener implementation, but using boost::asio when count connected sockets > 1000-1100 i have an error - "Too many opened files"
How can i fix that?
Thanks!
This isn't a boost::asio problem. This is an OS-level problem. Try doing ulimit -a
on the command line and you'll see there's a limit for 'open files'. This is the number of file descriptors a process is allowed to own. It can be changed, but it's the reason you're getting the error.
This stack overflow question "How do I change the number of open files limit in Linux?" talks about how this limit can be changed. The short answer is that it's not particularly simple to do. It's an OS-level configuration parameter.