MultiplexingRelayServiceBroker.ConnectToServerAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the MultiplexingRelayServiceBroker class and establishes a Nerdbank.Streams.MultiplexingStream protocol with the client over the given stream.
public static System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.MultiplexingRelayServiceBroker> ConnectToServerAsync (Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, System.IO.Stream duplexStreamWithClient, System.Threading.CancellationToken cancellationToken = default);
static member ConnectToServerAsync : Microsoft.ServiceHub.Framework.IServiceBroker * System.IO.Stream * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.ServiceHub.Framework.MultiplexingRelayServiceBroker>
Public Shared Function ConnectToServerAsync (serviceBroker As IServiceBroker, duplexStreamWithClient As Stream, Optional cancellationToken As CancellationToken = Nothing) As Task(Of MultiplexingRelayServiceBroker)
Parameters
- serviceBroker
- IServiceBroker
A broker for services to be relayed.
- duplexStreamWithClient
- Stream
The duplex stream over which the client will make RPC calls to the returned IRemoteServiceBroker instance. A multiplexing stream will be established on this stream and the client is expected to accept an offer for a channel with an Empty name. This object is considered "owned" by the returned MultiplexingRelayServiceBroker and will be disposed when the returned value is disposed, or disposed before this method throws.
- cancellationToken
- CancellationToken
A cancellation token.
Returns
A MultiplexingRelayServiceBroker that provides access to remote services, all over a multiplexing stream.
Remarks
The RemoteServiceBroker is used as the wire protocol.