[zeromq-dev] send with ZMQ_NOBLOCK
Martin Sustrik
sustrik at 250bpm.com
Wed May 19 06:30:17 CEST 2010
Chuck,
> I have a question about zmq_msg_t managment when using send with the
> ZMQ_NOBLOCK flag.
>
> If the send fails, is it proper to call zmq_msg_close on the current
> zmq_msg_t?
>
> With the ruby bindings, I don't call zmq_msg_close until the message
> goes out of scope and the garbage collector collects it. Am I waiting
> too long? Should I be calling it immediately after every send attempt
> whether or not the send is successful?
You should definitely call zmq_msg_close each time message is not going
to be used anymore, not depending on whether the send was successful or not.
Martin
More information about the zeromq-dev
mailing list