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.

  1. The client begins the sequence by creating an RPC binding for the server. Next, the client calls the R_GetServerPort (Opnum 0) (section 3.1.4.1) 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.

  2. Using the binding from the previous step, the client calls the R_OpenQueue (Opnum 2) (section 3.1.4.2) 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 2.2.4.2) handle.

  3. The client calls the R_PurgeQueue (Opnum 6) (section 3.1.4.6) 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.

  4. Finally, the client closes the QUEUE_CONTEXT_HANDLE_SERIALIZE handle with a call to the R_CloseQueue (Opnum 3) (section 3.1.4.3) method.

The client binds to a server and purges a queue.

Figure 1: The client binds to a server and purges a queue.