4.1.10 Host Method Calls Targeted to a Client’s Pipeline

The PowerShell Remoting Protocol allows a server to initiate method calls on the client's host. The typical sequence for initiating the host method call is described in the following table:

Step

Client

Direction

Server

1

The server's pipeline is in the Running state.

2

The client processes the Host Method call associated with the PIPELINE_HOST_CALL message (section 2.2.2.27) and extracts the method to execute (section 2.2.3.17).

The client hands over the message to the higher layer for further processing.

<

If a response is expected from the Host method call, the server constructs an integer identifier to represent the message, to be sent, and stores it in the Host calls CI table (section 3.2.1.2.6).

The server constructs a PIPELINE_HOST_CALL message (section 2.2.2.27) and sends it to the client using wxf:ReceiveResponse message (section 3.2.5.3.8).

If a response is expected from the Host method call, the server pauses executing the pipeline until a response for the Host method is received.

3

If a response (or return value) is expected from the Host method (section 2.2.3.17), the client constructs a PIPELINE_HOST_RESPONSE message (section 3.2.5.4.28) and send it to the server using wxf:Send message (section 3.1.5.3.5) targeted to the pipeline.

>

The server processes the message and removes the corresponding entry from the Host calls CI table (section 3.2.1.2.6).

The server extracts the response portion of the PIPELINE_HOST_RESPONSE message, hands it over to the pipeline and resumes executing the pipeline.

If a response is not expected from the Host Method call, then:

  • The CI table is not updated on the server in Step 2.

  • The server does not pause the execution of the pipeline in Step 2.

  • Step 3 is skipped.