4.1 Binding to a Server and Purging a Queue
The sequence diagram that follows illustrates a scenario when the client purges a queue. In addition, it shows how the static RPC endpoint port is acquired by the client to create an RPC binding handle.
The client begins the sequence by creating an RPC binding for the server. Next, the client calls the R_GetServerPort (Opnum 0) (section 22.214.171.124) method, which returns an RPC endpoint port number with which the client creates a new binding. The client uses the new binding for all subsequent calls to the server.
Using the binding from the previous step, the client calls the R_OpenQueue (Opnum 2) (section 126.96.36.199) method, requesting the MQ_RECEIVE_ACCESS (0x00000001) access mode and a share mode, in addition to client-specific values for the pClientId, fNonRoutingServer, Major, Minor, BuildNumber, and fWorkgroup parameters. On success, the server returns a new QUEUE_CONTEXT_HANDLE_SERIALIZE (section 188.8.131.52) handle.
The client calls the R_PurgeQueue (Opnum 6) (section 184.108.40.206) method. The server confirms that the queue was opened with the MQ_RECEIVE_ACCESS (0x00000001) access mode and then removes all messages from the queue.
Finally, the client closes the QUEUE_CONTEXT_HANDLE_SERIALIZE handle with a call to the R_CloseQueue (Opnum 3) (section 220.127.116.11) method.
Figure 1: The client binds to a server and purges a queue.