VortexFrame * vortex_channel_wait_reply ( VortexChannel channel,
int  msg_no,
WaitReplyData wait_reply 
)

Allows caller to wait for a particular reply to be received.

Check this section to know more about how to use this function inside the Wait Reply Method.

Keep in mind that this function could return a NULL frame while performing a wait. This timeout is configured through the following functions:

Parameters
channelThe channel where Wait Reply is done. This value is not optional and should be a valid channel. This function will check if the reference provided is not NULL.
msg_noThe message number we are waiting to be replied. This value is not optional and should be greater than 0. (Deprecated value, no longer used, keept for historic and backward compact).
wait_replyThe wait reply object used. A valid wait reply object created by vortex_channel_create_wait_reply. This function will check if the provided value is not NULL.
Returns
The frame reply or NULL if a timeout occurs, having all parameters well specified, or there was a parameter error detected.

NOTE: In the case the function returns a valid frame, your application must terminate it by using vortex_frame_unref. The reference to the wait_reply object is also terminated in this case (with vortex_channel_free_wait_reply). If the function returns NULL (frame) the caller must dealloc the wait_reply object (or reuse it for a future call).

NOTE 2: You cannot use the same WaitReplyData for several successful wait operations. You must create a new one WaitReplyData object for each call done to this function (vortex_channel_wait_reply). You can only reuse a wait_reply object in the case the function returns NULL (frame).

References vortex_async_queue_pop(), vortex_async_queue_ref(), vortex_async_queue_timedpop(), vortex_async_queue_unref(), vortex_channel_free_wait_reply(), vortex_channel_get_ctx(), vortex_channel_get_data(), vortex_channel_ref2(), vortex_channel_set_data(), vortex_channel_unref2(), vortex_connection_get_timeout(), vortex_connection_is_ok(), vortex_connection_remove_on_close_full(), and vortex_connection_set_on_close_full2().