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
uri
UriThe URI of the NATS server to connect to.
opts
NatsOptsThe Options associated with the NATS Client.
cancellationToken
CancellationTokenA token to cancel the asynchronous operation.
Returns
- ValueTask<INatsSocketConnection>
A task that represents the asynchronous connect operation. The task result contains the socket connection.