共用方式為


HubClient Class

Definition

This class allows Service Hub clients to find the location and start Service hub services.

public ref class HubClient : IDisposable, Microsoft::ServiceHub::Framework::IServiceBroker
public class HubClient : IDisposable, Microsoft.ServiceHub.Framework.IServiceBroker
type HubClient = class
    interface IDisposable
    interface IServiceBroker
Public Class HubClient
Implements IDisposable, IServiceBroker
Inheritance
HubClient
Implements

Constructors

HubClient(String, IReadOnlyDictionary<ServiceMoniker,String>)
HubClient(String, String, IReadOnlyDictionary<ServiceMoniker,String>)
HubClient(String, String)
HubClient(String)

Properties

ClientName

Gets the name of the client as it was provided to the HubClient constructor.

DisposeToken

Gets a cancellation token that signals when this object has been disposed.

Logger

Gets the logger associated with this client.

Methods

Dispose()
Dispose(Boolean)
GetHostProcessIdsAsync(CancellationToken)

Gets the set of process ids that the Controller process has spawned.

GetPipeAsync(ServiceMoniker, ServiceActivationOptions, CancellationToken)

Requests access to some service through an IDuplexPipe.

GetProxyAsync<T>(ServiceRpcDescriptor, ServiceActivationOptions, CancellationToken)

Requests access to some service through a client proxy.

GetRemoteServiceBrokerForServiceAsync(ServiceMoniker, IReadOnlyDictionary<String,String>, CancellationToken)

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

GetSessionIdAsync(CancellationToken)

Get session id. Session ID is a unique string that stays the same during dev hub session (life time of hub controller) and is different for different sessions.

GetThisAsRemoteServiceBrokerAsync()
RegisterService(ServiceMoniker, ServiceModuleInfo)

Register a service with an in memory ServiceModuleInfo so that it can be requested via this HubClient object later.

RequestServiceAsync(ServiceDescriptor, CancellationToken)

Locate and start a service module on Service Hub.

RequestServiceAsync(String, CancellationToken)

Locate and start a service module on Service Hub.

SetUpServiceActivationOptionsForServiceRequestAsync(ServiceActivationOptions, ServiceMoniker, CancellationToken)
UnregisterService(ServiceMoniker)

Unregister a service so that future requests for this service will not use the previously registered ServiceModuleInfo. Attempting to unregister a service that had not previously been registered will result in a no-op.

Explicit Interface Implementations

IServiceBroker.AvailabilityChanged

Extension Methods

GetPipeAsync(IServiceBroker, ServiceMoniker, CancellationToken)

Requests access to some service through an IDuplexPipe.

GetProxyAsync<T>(IServiceBroker, ServiceJsonRpcDescriptor<T>, CancellationToken)

Requests access to some service through a client proxy.

GetProxyAsync<T>(IServiceBroker, ServiceRpcDescriptor, CancellationToken)

Requests access to some service through a client proxy.

CompareLocalToRemoteVersionAsync(IServiceBroker, ServiceMoniker, CancellationToken)

Compares a locally recognized service to what is available remotely for the same service.

ReportMissingServiceAsync(IServiceBroker, String, String, ServiceMoniker, Guid, UInt32, CancellationToken)

Presents modeless UI to the user that explains why a feature is disabled or operating with reduced functionality.

Applies to