简体   繁体   中英

Stop zmq message

When I use send and the addressee is not listening, zmq internally will keep trying until the message is delivered. Are there any way to stop this? For example, try for 5 seconds and stop? Thanks.

Try to use zmq_setsockopt and set the ZMQ_LINGER option (that is the timeout for subsequent operations).

send can also use ZMQ_NOBLOCK to return immediately, but then subsequent close will still block, so the ZMQ_LINGER option is preferred.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM