IServiceBroker.GetPipeAsync Method

Definition

Requests access to some service through an IDuplexPipe.

public System.Threading.Tasks.ValueTask<System.IO.Pipelines.IDuplexPipe?> GetPipeAsync (Microsoft.ServiceHub.Framework.ServiceMoniker serviceMoniker, Microsoft.ServiceHub.Framework.ServiceActivationOptions options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetPipeAsync : Microsoft.ServiceHub.Framework.ServiceMoniker * Microsoft.ServiceHub.Framework.ServiceActivationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<System.IO.Pipelines.IDuplexPipe>
Public Function GetPipeAsync (serviceMoniker As ServiceMoniker, Optional options As ServiceActivationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of IDuplexPipe)

Parameters

serviceMoniker
ServiceMoniker

The moniker for the service.

options
ServiceActivationOptions

Additional options that alter how the service may be activated or provide additional data to the service constructor.

cancellationToken
CancellationToken

A cancellation token.

Returns

The duplex pipe that may be used to communicate with the service; or null if no matching service could be found. This should be disposed when no longer required.

Exceptions

Thrown when a service discovery or activation error occurs, or when the only service activation option is local service host activation since this overload does not accept a ServiceRpcDescriptor parameter.

Applies to