private processUrlString ( string url ) : void | ||
url | string | |
Результат | void |
/// <summary> /// Attempt to connect to the NATS server referenced by <paramref name="url"/>. /// </summary> /// <remarks> /// <para><paramref name="url"/> can contain username/password semantics. /// Comma seperated arrays are also supported, e.g. <c>"urlA, urlB"</c>.</para> /// </remarks> /// <param name="url">A string containing the URL (or URLs) to the NATS Server. See the Remarks /// section for more information.</param> /// <returns>An <see cref="IConnection"/> object connected to the NATS server.</returns> /// <exception cref="NATSNoServersException">No connection to a NATS Server could be established.</exception> /// <exception cref="NATSConnectionException"><para>A timeout occurred connecting to a NATS Server.</para> /// <para>-or-</para> /// <para>An exception was encountered while connecting to a NATS Server. See <see cref="Exception.InnerException"/> for more /// details.</para></exception> public IConnection CreateConnection(string url) { Options opts = new Options(); opts.processUrlString(url); return(CreateConnection(opts)); }
/// <summary> /// Attempt to connect to the NATS server referenced by <paramref name="url"/> with NATS 2.0 credentials. /// </summary> /// <remarks> /// <para><paramref name="url"/> /// Comma seperated arrays are also supported, e.g. <c>"urlA, urlB"</c>.</para> /// </remarks> /// <param name="url">A string containing the URL (or URLs) to the NATS Server. See the Remarks /// section for more information.</param> /// <param name="credentialsPath">The full path to a chained credentials file.</param> /// <returns>An <see cref="IConnection"/> object connected to the NATS server.</returns> /// <exception cref="NATSNoServersException">No connection to a NATS Server could be established.</exception> /// <exception cref="NATSConnectionException"><para>A timeout occurred connecting to a NATS Server.</para> /// <para>-or-</para> /// <para>An exception was encountered while connecting to a NATS Server. See <see cref="Exception.InnerException"/> for more /// details.</para></exception> public IConnection CreateConnection(string url, string credentialsPath) { if (string.IsNullOrWhiteSpace(credentialsPath)) { throw new ArgumentException("Invalid credentials path", "credentials"); } Options opts = new Options(); opts.processUrlString(url); opts.SetUserCredentials(credentialsPath); return(CreateConnection(opts)); }
/// <summary> /// Attempt to connect to the NATS server referenced by <paramref name="url"/> with NATS 2.0 credentials. /// </summary> /// <remarks> /// <para><paramref name="url"/> /// Comma seperated arrays are also supported, e.g. <c>"urlA, urlB"</c>.</para> /// </remarks> /// <param name="url">A string containing the URL (or URLs) to the NATS Server. See the Remarks /// section for more information.</param> /// <param name="jwt">The path to a user's public JWT credentials.</param> /// <param name="privateNkey">The path to a file for user user's private Nkey seed.</param> /// <returns>An <see cref="IConnection"/> object connected to the NATS server.</returns> /// <exception cref="NATSNoServersException">No connection to a NATS Server could be established.</exception> /// <exception cref="NATSConnectionException"><para>A timeout occurred connecting to a NATS Server.</para> /// <para>-or-</para> /// <para>An exception was encountered while connecting to a NATS Server. See <see cref="Exception.InnerException"/> for more /// details.</para></exception> public IConnection CreateConnection(string url, string jwt, string privateNkey) { if (string.IsNullOrWhiteSpace(jwt)) { throw new ArgumentException("Invalid jwt path", "jwt"); } if (string.IsNullOrWhiteSpace(privateNkey)) { throw new ArgumentException("Invalid nkey path", "privateNkey"); } Options opts = new Options(); opts.processUrlString(url); opts.SetUserCredentials(jwt, privateNkey); return(CreateConnection(opts)); }
/// <summary> /// CreateConnection will attempt to connect to the NATS server. /// The url can contain username/password semantics. /// Comma seperated arrays are also supported, e.g. urlA, urlB. /// </summary> /// <param name="url">The url</param> /// <returns>A new connection to the NATS server</returns> public IConnection CreateConnection(string url) { Options opts = new Options(); opts.processUrlString(url); return CreateConnection(opts); }