I think I came up with something that will work. I'm trying to implement a carrier sense/collision avoidance scheme for wireless packet transmission. Whenever the rx chain detects a packet, it pushes it via zmq it to another process running a controller script which runs a state machine between "backoff", "listen", and "talk" states. The problem I was having was that I was only handling zmq messages during the "listen" state and so if I had two USRPs trying to transmit messages, whichever went first would cause the other to backoff and then messages would build up in the the receivers queue (or whatever the buffered memory zmq uses). I was thinking that if I could somehow programmatically close and reopen the socket only when I was in the listen state I could prevent this buildup.
I ended up changing the logic of the control program to continuously call the zmq poller and then handle the message only if the backoff time expired and it was attempting to transmit, which seems to be working for what I want
There's probably a cleaner and more semantic way of doing this. I am by no means an expert at gnuradio or sockets, but I think what I have is good enough for now.
Thanks for your help,
Cameron