On Mon, Oct 27, 2014 at 12:12 PM, Dominic Evans <[email protected]> wrote:
> When using messenger in non-blocking mode, it is possible to ensure that > the > empty frame heartbeats are sent by calling pn_messenger_work(timeout) on a > regular interval (when no other send / recv operations are happening). > > However, when using messenger in blocking mode it is not obvious how one > should achieve this without optional timeout arguments on all the calls? > > For example, both pn_messenger_send and pn_messenger_recv accept limits of > the number of messages to send and receive during the block, but no option > for a timeout on these. > You can set the timeout that any blocking calls use with pn_messenger_get/set_timeout, however there is no need to do this in order to ensure that heartbeat frames are sent. That should happen even when messenger is blocked in pn_messenger_send or pn_messenger_recv. --Rafael
