First off, my apologies if this is already answered. I did a quick search and didn't see anything.
I've got a multi-threaded application that's receiving messages from LOTS of ZMQ publishers. Each publisher binds to the receiver on a known port. The subscriber is given a random port. Which is all well and good. But I'm running out of file handled on my Linux box while this is running, and what I see when I look at "lsof" is that it APPEARS that my app has a subscriber with an established connection on EVERY thread in my app. I create the ZMQ context in the main thread of my app, only once, as recommended. I call zmq_bind (on the subscriber) only once, in the thread that receives the messages. Everything runs correctly... except that I have 1000's of file handles open due to the duplication across all the threads. Each thread in my app shows an established TCP connection (according to lsof at any rate) for each address, on each port.
I'm baffled... is there something obvious I'm doing wrong here?
Thank in advance!
Scott