다음을 통해 공유


HubClient.GetRemoteServiceBrokerForServiceAsync Method

Definition

Gets an IRemoteServiceBroker relevant to the service that is asking for it.

protected virtual System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.IRemoteServiceBroker> GetRemoteServiceBrokerForServiceAsync (Microsoft.ServiceHub.Framework.ServiceMoniker consumingService, System.Collections.Generic.IReadOnlyDictionary<string,string> userCredentials, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRemoteServiceBrokerForServiceAsync : Microsoft.ServiceHub.Framework.ServiceMoniker * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.IRemoteServiceBroker>
override this.GetRemoteServiceBrokerForServiceAsync : Microsoft.ServiceHub.Framework.ServiceMoniker * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.IRemoteServiceBroker>
Protected Overridable Function GetRemoteServiceBrokerForServiceAsync (consumingService As ServiceMoniker, userCredentials As IReadOnlyDictionary(Of String, String), Optional cancellationToken As CancellationToken = Nothing) As Task(Of IRemoteServiceBroker)

Parameters

consumingService
ServiceMoniker

The ServiceMoniker of the service that is requesting the IRemoteServiceBroker.

userCredentials
IReadOnlyDictionary<String,String>

The credentials of the user to be used to filter the ServiceBroker that is returned.

cancellationToken
CancellationToken

Cancellation token.

Returns

An IRemoteServiceBroker relevant to the service that is asking for it.

Remarks

The returned object is disposed (if it implements IDisposable) when the service disposes of its connection to it. The default implementation returns a new object every time, but the new object is just a wrapper for the same IRemoteServiceBroker proxy. The returned object should also not be a JsonRpc proxy since it will be attached to a Stream via JsonRpc.

Applies to