Table of Contents

Class LocatorInterceptor

Namespace
IceRpc.Locator
Assembly
IceRpc.Locator.dll

A locator interceptor intercepts ice requests that have no server address and attempts to assign a usable server address (and alt-server addresses) to such requests via the IServerAddressFeature. You would usually install the retry interceptor before the locator interceptor in the invocation pipeline and use the connection cache invoker for the pipeline, with this setup the locator interceptor would be able to detect invocation retries and refreshes the server address when required, and the connection cache would take care of creating the connections for the resolved server address.

public class LocatorInterceptor : IInvoker
Inheritance
LocatorInterceptor
Implements
Inherited Members
Extension Methods

Constructors

LocatorInterceptor(IInvoker, ILocationResolver)

Constructs a locator interceptor.

public LocatorInterceptor(IInvoker next, ILocationResolver locationResolver)

Parameters

next IInvoker

The next invoker in the invocation pipeline.

locationResolver ILocationResolver

The location resolver. It is usually a LocatorLocationResolver.

Methods

InvokeAsync(OutgoingRequest, CancellationToken)

Sends an outgoing request and returns the corresponding incoming response.

public Task<IncomingResponse> InvokeAsync(OutgoingRequest request, CancellationToken cancellationToken)

Parameters

request OutgoingRequest

The outgoing request being sent.

cancellationToken CancellationToken

A cancellation token that receives the cancellation requests.

Returns

Task<IncomingResponse>

The corresponding IncomingResponse.

Remarks

When request is a two-way request, the returned task will not complete successfully until after the request's Payload is fully sent and the response is received from the peer. When the request is a one-way request, the returned task completes successfully with an empty response when the request's Payload is fully sent. For all requests (one-way and two-way), the sending of the request's PayloadContinuation can continue in a background task after the returned task has completed successfully.