0

It is not HasOut.

I understand that when I send a message (SendFrame), it does not mean it is really sent, but only queued until successfully sending it.

So when I would like to send another message there is no point in doing so if the first one was not actually sent (for me). In short -- I would like to work in such loop: send a message if the outgoing queue is empty, repeat.

I know how to send a message, but how to check if the queue is empty?

I use DealerSockect if this makes a difference.

astrowalker
  • 3,123
  • 3
  • 21
  • 40
  • I know it is not what you asked, but just want to mention it. NetMQ batch messages on the wire, so sometimes it is make sense to send one after the other. – somdoron May 26 '17 at 10:26
  • Regarding your question, it is not possible, if queue is emtpy it does not mean other side get it. – somdoron May 26 '17 at 10:27
  • I would suggest to get implement application level message ack. – somdoron May 26 '17 at 10:28
  • 1
    Another option is to send the message every X milliseconds. Also take a look at credit based flow control http://hintjens.com/blog:15 – somdoron May 26 '17 at 10:30
  • @somdoron, I am only interested if the message was sent or not, if the receiver got it -- not a problem. According to ZMQ Guide I cannot send message every X secs, because dealer will then (after connection) send **all** the messages flooding the receiver -- and it is exactly what I would like to avoid and the reason I am asking. – astrowalker May 26 '17 at 10:44
  • @somdoron, I set HWM to 1 (for sending) and in such case `hasOut` works like reverse indicator if the queue is empty or not. So far it seems like a solution. – astrowalker May 26 '17 at 11:12
  • Seems like good idea – somdoron May 26 '17 at 12:13

0 Answers0