How do linux file descriptor limits work?

前端 未结 3 870
攒了一身酷
攒了一身酷 2020-12-23 18:08

I was told that my server refused to accept client network connections at a specific port could be due to the lack of file descriptors. I looked up what this is all about an

3条回答
  •  鱼传尺愫
    2020-12-23 18:41

    What error are you getting from accept() under these circumstances? Check errno and report it accordingly.

    According to the man page, accept() will give EMFILE or ENFILE if the per-process or overall file descriptor limit has been reached, it would be helpful to know which (or if there was something else).

    There is a per-process file descriptor limit which is often set to 1024 - but can easily be increased.

提交回复
热议问题