[zeromq-dev] fd leak with dealer to dealer with tcp as transport

donthamsetty sivaprasad shivp at rocketmail.com
Thu Nov 14 13:29:50 CET 2019

 Hi ,thanks for the response.I have multiple tasks(threads).Each task has tx and rx ZMQ DEALER sockets with bind to tcp addresses.Each guy before sending a packet to other one does zmq_connect , zmq_msg_send and zmq_disconnect. The reason for doing zmq_disconnect is sender's next packet could be to a different receiver other than the first one.
Now the first question is does zmq_disconnect destroys tcp sockets underneath or not ..( for that sender/receiver combo)??
When I did lsof it shows very huge number something like 50K..

    On Thursday, November 14, 2019, 04:57:22 PM GMT+5:30, Arnaud Loonstra <arnaud at sphaero.org> wrote:  
 On 14-11-2019 10:07, donthamsetty sivaprasad via zeromq-dev wrote:
> Hi ,
> I have DEALER sockets with tcp as transport.
> Before sending each packet I do zmq_connect , zmq_msg_send and 
> zmq_disconnect since same DEALER can talk to another dealer ( it is many 
> to many communication ,but no load bancing or round robin)..
> The system is crashing running out of file descriptors in the system..
> Could you please help me..?
> Thanks
> Siva

Please show some code which demonstrates your problem. It sounds like 
you are constantly creating new sockets without destroying them. In 
general you first connect and then send the message. You only disconnect 
if you need to (usually on destroy). Also have you read the zeromq 
guide? It shows many examples.


zeromq-dev mailing list
zeromq-dev at lists.zeromq.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20191114/7b087c0b/attachment.htm>

More information about the zeromq-dev mailing list