HubClient.GetRemoteServiceBrokerForServiceAsync 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与 IRemoteServiceBroker 正在请求的服务相关的。
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)
参数
- consumingService
- ServiceMoniker
ServiceMoniker请求的服务的 IRemoteServiceBroker 。
- userCredentials
- IReadOnlyDictionary<String,String>
要用于筛选返回的 ServiceBroker 的用户的凭据。
- cancellationToken
- CancellationToken
取消标记。
返回
与 IRemoteServiceBroker 正在请求的服务相关的。
注解
返回的对象会在服务通过其连接时 (实现 IDisposable) 来释放。 默认实现每次都会返回一个新的对象,但是新对象只是同一 IRemoteServiceBroker 代理的包装。 返回的对象也不应是 JsonRpc 代理,因为它将通过 JsonRpc 附加到 Stream 。