Share via


RemoteServiceBroker.ConnectToMultiplexingServerAsync Method

Definition

Overloads

ConnectToMultiplexingServerAsync(Stream, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

ConnectToMultiplexingServerAsync(IRemoteServiceBroker, MultiplexingStream, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class.

ConnectToMultiplexingServerAsync(Stream, MultiplexingStream+Options, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

ConnectToMultiplexingServerAsync(Stream, MultiplexingStream+Options, TraceSource, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

ConnectToMultiplexingServerAsync(Stream, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

public static System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker> ConnectToMultiplexingServerAsync (System.IO.Stream duplexStream, System.Threading.CancellationToken cancellationToken = default);
static member ConnectToMultiplexingServerAsync : System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker>
Public Shared Function ConnectToMultiplexingServerAsync (duplexStream As Stream, Optional cancellationToken As CancellationToken = Nothing) As Task(Of RemoteServiceBroker)

Parameters

duplexStream
Stream

A full duplex stream on which to create a multiplexing stream. This multiplexing stream is expected to offer a default channel (Empty name) with a IRemoteServiceBroker service. This object is considered "owned" by the returned RemoteServiceBroker and will be disposed when the returned value is disposed, or disposed before this method throws.

cancellationToken
CancellationToken

A cancellation token.

Returns

An IServiceBroker that provides access to remote services.

Applies to

ConnectToMultiplexingServerAsync(IRemoteServiceBroker, MultiplexingStream, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class.

public static System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker> ConnectToMultiplexingServerAsync (Microsoft.ServiceHub.Framework.IRemoteServiceBroker serviceBroker, Nerdbank.Streams.MultiplexingStream multiplexingStream, System.Threading.CancellationToken cancellationToken = default);
static member ConnectToMultiplexingServerAsync : Microsoft.ServiceHub.Framework.IRemoteServiceBroker * Nerdbank.Streams.MultiplexingStream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker>
Public Shared Function ConnectToMultiplexingServerAsync (serviceBroker As IRemoteServiceBroker, multiplexingStream As MultiplexingStream, Optional cancellationToken As CancellationToken = Nothing) As Task(Of RemoteServiceBroker)

Parameters

serviceBroker
IRemoteServiceBroker

An existing proxy established to acquire remote services. This object is considered "owned" by the returned RemoteServiceBroker and will be disposed when the returned value is disposed, or disposed before this method throws.

multiplexingStream
Nerdbank.Streams.MultiplexingStream

A multiplexing stream that underlies the serviceBroker proxy.

cancellationToken
CancellationToken

A cancellation token.

Returns

An IServiceBroker that provides access to remote services.

Remarks

The RemoteServiceBroker is used as the wire protocol.

Applies to

ConnectToMultiplexingServerAsync(Stream, MultiplexingStream+Options, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

public static System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker> ConnectToMultiplexingServerAsync (System.IO.Stream duplexStream, Nerdbank.Streams.MultiplexingStream.Options? options, System.Threading.CancellationToken cancellationToken = default);
static member ConnectToMultiplexingServerAsync : System.IO.Stream * Nerdbank.Streams.MultiplexingStream.Options * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker>
Public Shared Function ConnectToMultiplexingServerAsync (duplexStream As Stream, options As MultiplexingStream.Options, Optional cancellationToken As CancellationToken = Nothing) As Task(Of RemoteServiceBroker)

Parameters

duplexStream
Stream

A full duplex stream on which to create a multiplexing stream. This multiplexing stream is expected to offer a default channel (Empty name) with a IRemoteServiceBroker service. This object is considered "owned" by the returned RemoteServiceBroker and will be disposed when the returned value is disposed, or disposed before this method throws.

options
Nerdbank.Streams.MultiplexingStream.Options

Options to pass along to the created Nerdbank.Streams.MultiplexingStream on creation.

cancellationToken
CancellationToken

A cancellation token.

Returns

An IServiceBroker that provides access to remote services.

Applies to

ConnectToMultiplexingServerAsync(Stream, MultiplexingStream+Options, TraceSource, CancellationToken)

Initializes a new instance of the RemoteServiceBroker class that connects to an IRemoteServiceBroker on the default channel after establishing a Nerdbank.Streams.MultiplexingStream on the given Stream.

public static System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker> ConnectToMultiplexingServerAsync (System.IO.Stream duplexStream, Nerdbank.Streams.MultiplexingStream.Options? options, System.Diagnostics.TraceSource? traceSource, System.Threading.CancellationToken cancellationToken = default);
static member ConnectToMultiplexingServerAsync : System.IO.Stream * Nerdbank.Streams.MultiplexingStream.Options * System.Diagnostics.TraceSource * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.RemoteServiceBroker>
Public Shared Function ConnectToMultiplexingServerAsync (duplexStream As Stream, options As MultiplexingStream.Options, traceSource As TraceSource, Optional cancellationToken As CancellationToken = Nothing) As Task(Of RemoteServiceBroker)

Parameters

duplexStream
Stream

A full duplex stream on which to create a multiplexing stream. This multiplexing stream is expected to offer a default channel (Empty name) with a IRemoteServiceBroker service. This object is considered "owned" by the returned RemoteServiceBroker and will be disposed when the returned value is disposed, or disposed before this method throws.

options
Nerdbank.Streams.MultiplexingStream.Options

Options to pass along to the created Nerdbank.Streams.MultiplexingStream on creation.

traceSource
TraceSource

An optional means of logging activity.

cancellationToken
CancellationToken

A cancellation token.

Returns

An IServiceBroker that provides access to remote services.

Applies to