Inherits NATS.Client.IConnectionFactory.
|
| ConnectionFactory () |
|
IConnection | CreateConnection (string url, bool reconnectOnConnect=false) |
|
IConnection | CreateConnection (string url, string credentialsPath, bool reconnectOnConnect=false) |
|
IConnection | CreateConnection (string url, string jwt, string privateNkey, bool reconnectOnConnect=false) |
|
IConnection | CreateSecureConnection (string url, bool reconnectOnConnect=false) |
|
IConnection | CreateConnection (bool reconnectOnConnect=false) |
|
IConnection | CreateConnection (Options opts, bool reconnectOnConnect=false) |
|
IEncodedConnection | CreateEncodedConnection (bool reconnectOnConnect=false) |
|
IEncodedConnection | CreateEncodedConnection (string url, bool reconnectOnConnect=false) |
|
IEncodedConnection | CreateEncodedConnection (Options opts, bool reconnectOnConnect=false) |
|
Provides factory methods to create connections to NATS Servers.
◆ CreateConnection() [1/5]
IConnection NATS.Client.ConnectionFactory.CreateConnection |
( |
bool |
reconnectOnConnect = false | ) |
|
Create a connection to the NATs server using the default options.
- Parameters
-
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
- See also
- GetDefaultOptions
◆ CreateConnection() [2/5]
IConnection NATS.Client.ConnectionFactory.CreateConnection |
( |
Options |
opts, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Create a connection to a NATS Server defined by the given options.
- Parameters
-
opts | The NATS client options to use for this connection. |
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
◆ CreateConnection() [3/5]
IConnection NATS.Client.ConnectionFactory.CreateConnection |
( |
string |
url, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Attempt to connect to the NATS server referenced by url .
url can contain username/password semantics. Comma seperated arrays are also supported, e.g. "urlA, urlB"
.
- Parameters
-
url | A string containing the URL (or URLs) to the NATS Server. See the Remarks section for more information. |
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
◆ CreateConnection() [4/5]
IConnection NATS.Client.ConnectionFactory.CreateConnection |
( |
string |
url, |
|
|
string |
credentialsPath, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Attempt to connect to the NATS server referenced by url with NATS 2.0 credentials.
url Comma seperated arrays are also supported, e.g. "urlA, urlB"
.
- Parameters
-
url | A string containing the URL (or URLs) to the NATS Server. See the Remarks section for more information. |
credentialsPath | The full path to a chained credentials file. |
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
◆ CreateConnection() [5/5]
IConnection NATS.Client.ConnectionFactory.CreateConnection |
( |
string |
url, |
|
|
string |
jwt, |
|
|
string |
privateNkey, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Attempt to connect to the NATS server referenced by url with NATS 2.0 credentials.
url Comma seperated arrays are also supported, e.g. "urlA, urlB"
.
- Parameters
-
url | A string containing the URL (or URLs) to the NATS Server. See the Remarks section for more information. |
jwt | The path to a user's public JWT credentials. |
privateNkey | The path to a file for user user's private Nkey seed. |
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
◆ CreateEncodedConnection() [1/3]
IEncodedConnection NATS.Client.ConnectionFactory.CreateEncodedConnection |
( |
bool |
reconnectOnConnect = false | ) |
|
Attempt to connect to the NATS server, with an encoded connection, using the default options.
- Parameters
-
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IEncodedConnection object connected to the NATS server.
- See also
- GetDefaultOptions
- Exceptions
-
◆ CreateEncodedConnection() [2/3]
Attempt to connect to the NATS server, with an encoded connection, using the given options.
- Parameters
-
opts | The NATS client options to use for this connection. |
- Returns
- An IEncodedConnection object connected to the NATS server.
- Parameters
-
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Exceptions
-
◆ CreateEncodedConnection() [3/3]
IEncodedConnection NATS.Client.ConnectionFactory.CreateEncodedConnection |
( |
string |
url, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Attempt to connect to the NATS server, with an encoded connection, referenced by url .
url can contain username/password semantics. Comma seperated arrays are also supported, e.g. urlA, urlB.
- Parameters
-
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Parameters
-
url | A string containing the URL (or URLs) to the NATS Server. See the Remarks section for more information. |
- Returns
- An IEncodedConnection object connected to the NATS server.
- Exceptions
-
◆ CreateSecureConnection()
IConnection NATS.Client.ConnectionFactory.CreateSecureConnection |
( |
string |
url, |
|
|
bool |
reconnectOnConnect = false |
|
) |
| |
Attempt to connect to the NATS server using TLS referenced by url .
url can contain username/password semantics. Comma seperated arrays are also supported, e.g. urlA, urlB.
- Parameters
-
url | A string containing the URL (or URLs) to the NATS Server. See the Remarks section for more information. |
reconnectOnConnect | if true, the connection will treat the initial connection as any other and attempt reconnects on failure |
- Returns
- An IConnection object connected to the NATS server.
- Exceptions
-
◆ GetDefaultOptions()
static Options NATS.Client.ConnectionFactory.GetDefaultOptions |
( |
string |
server = null | ) |
|
|
static |
Retrieves the default set of client options.
- Parameters
-
- Returns
- The default Options object for the NATS client.
The documentation for this class was generated from the following file: