Method ConnectAsync
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
uriUriThe URI of the NATS server to connect to.
optsNatsOptsThe Options associated with the NATS Client.
cancellationTokenCancellationTokenA token to cancel the asynchronous operation.
Returns
- ValueTask<INatsSocketConnection>
A task that represents the asynchronous connect operation. The task result contains the socket connection.