/// <summary> /// Initializes a new instance of the <see cref="Redis"/> class. /// </summary> /// <param name="host">The host.</param> /// <param name="port">The port.</param> /// <param name="connectTimeout">The connect timeout in milliseconds.</param> /// <param name="encoding">The encoding (optional: default ASCII).</param> /// <param name="password">The password required by the "requirepass" configuration directive on the server.</param> public Redis(string host = "127.0.0.1", int port = 6379, int connectTimeout = 1000, Encoding encoding = null, string password = null) { _encoding = encoding ?? Encoding.Default; _client = new ConnectionClient(host, port, connectTimeout, this.encoding); if (password != null) { _client.setAuthPassword(password); } _client.objectReceived += _client_objectReceived; _client.connectionError += _client_connectionError; _client.connect(); }
/// <summary> /// Initializes a new instance of the <see cref="Redis"/> class. /// </summary> /// <param name="host">The host.</param> /// <param name="port">The port.</param> /// <param name="connectTimeout">The connect timeout in milliseconds.</param> /// <param name="encoding">The encoding (optional: default ASCII).</param> /// <param name="password">The password required by the "requirepass" configuration directive on the server.</param> public Redis(string host = "127.0.0.1", int port = 6379, int connectTimeout = 1000, Encoding encoding = null, string password = null) { _encoding = encoding ?? Encoding.Default; _client = new ConnectionClient(host, port, connectTimeout, this.encoding); if (password != null) _client.setAuthPassword(password); _client.objectReceived += _client_objectReceived; _client.connectionError += _client_connectionError; _client.connect(); }