CMTransport.SendRequest
Method
Visual Basic
Overrides Public FunctionSendRequest
(
ByVal request As Message,
ByVal timeout As Double )
As Message
C#
public override MessageSendRequest
(
Message request,
double timeout );
Purpose
Send a labeled request message and wait for a reply.
Blocking can Stall Event Dispatch
Warning |
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 this request message. Wildcard subjects are illegal. |
|
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 SendSubject.
A certified request does not necessarily imply a certified reply; the replying program determines the type of reply message that it sends.
Operation
This method operates in several synchronous steps:
Procedure
1. | Create a CMListener that listens for messages on the reply subject of msg . |
2. | Label and send the outbound message . |
3. | Block until the listener receives a reply; if the time limit expires before a reply arrives, then return null. (The reply event uses a private queue that is not accessible to the program.) |
4. | Return the reply message as the value of the method call. |