Skip to content

Too many open files error when opening and closing socket too frequently #257

@lyskov

Description

@lyskov

I noticed that if i try to open/close ZeroMQ socket too frequently then it leads to zmq::error_t: Too many open files error. Why this happening and how can i fix this?

I do understand that i can increase upper limit of available sockets but this does not sounds like good solution to me because its only delay the error. After all: i do deallocate resources so why i am getting this error in the first place?

Sample code to reproduce (i tested this on v4.2.4 on Mac):

zmq::context_t context;
for(;;) {
    zmq::socket_t s (context, ZMQ_DEALER);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions