Table of Contents

Method ConnectAsync

Namespace
NATS.Client.Core
Assembly
NATS.Client.Core.dll

ConnectAsync(Uri, NatsOpts, CancellationToken)

Establishes a connection to a NATS server at the specified URI.

ValueTask<INatsSocketConnection> ConnectAsync(Uri uri, NatsOpts opts, CancellationToken cancellationToken)

Parameters

uri Uri

The URI of the NATS server to connect to.

opts NatsOpts

The Options associated with the NATS Client.

cancellationToken CancellationToken

A token to cancel the asynchronous operation.

Returns

ValueTask<INatsSocketConnection>

A task that represents the asynchronous connect operation. The task result contains the socket connection.