public static ResolveToEndPoint ( string value ) : |
||
value | string | |
Résultat |
public static EndPoint ResolveToEndPoint(string location) { if (string.IsNullOrWhiteSpace(location)) { throw new ArgumentNullException(nameof(location), "The location is required"); } var uri = new Uri((location.Contains("://") ? "" : "memcached://") + location); return(ConfigurationHelper.ResolveToEndPoint(uri.Host, uri.Port)); }
/// <summary> /// Adds a new server to the pool. /// </summary> /// <param name="address">The host name or IP address of the server.</param> /// <param name="port">The port number of the memcached instance.</param> public void AddServer(string address, int port) => this.Servers.Add(ConfigurationHelper.ResolveToEndPoint(address, port));
/// <summary> /// Adds a new server to the pool. /// </summary> /// <param name="address">The host name or IP address of the server.</param> /// <param name="port">The port number of the memcached instance.</param> public void AddServer(string host, int port) { this.Servers.Add(ConfigurationHelper.ResolveToEndPoint(host, port)); }
/// <summary> /// Adds a new server to the pool. /// </summary> /// <param name="address">The address and the port of the server in the format 'host:port'.</param> public void AddServer(string address) { this.Servers.Add(ConfigurationHelper.ResolveToEndPoint(address)); }