ServiceBrokerExtensions.GetPipeAsync Method

Definition

Requests access to some service through an IDuplexPipe.

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

Parameters

serviceBroker
IServiceBroker

The service broker.

serviceMoniker
ServiceMoniker

The moniker for the service.

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