tibrvcmTransport_SendRequest()
Function
Declaration
tibrv_status
tibrvcmTransport_SendRequest(
tibrvcmTransport cmTransport,
tibrvMsg message);
tibrvMsg* reply,
tibrv_f64 timeout);
Purpose
Send a labeled request message and wait for a reply.
Warning |
Blocking can Stall Event Dispatch
This call blocks all other activity on its program thread. If appropriate, programmers must ensure that other threads continue dispatching events on its queues. |
Parameter |
Description |
|
Send a message using this certified delivery transport. |
|
Send this request message. Wildcard subjects are illegal. |
|
The program supplies a location, and the function stores the inbound reply in that location. The program need not create the reply message, nor allocate space for it. However, the program must destroy the reply message, even though it did not create it. |
|
Maximum time (in seconds) that this call can block while waiting for a reply.
|
Remarks
Programs that receive and process the request message cannot determine that the sender has blocked until a reply arrives.
The sender and receiver must already have a certified delivery agreement, otherwise the request is not certified.
The request message must have a valid destination subject; see tibrvMsg_SetSendSubject().
A certified request does not necessarily imply a certified reply; the replying program determines the type of reply message that it sends.
Operation
This function operates in several synchronous steps:
Procedure
1. | Create a tibrvcmEvent that listens for messages on the reply subject of message . |
2. | Label and send the outbound message . |
3. | Block until the listener receives a reply; if the time limit expires before a reply arrives, return the status code TIBRV_TIMEOUT. (The reply event uses a private queue that is not accessible to the program.) |
4. | Store the reply in the location specified by the reply parameter. |
5. | Return. |