1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Merge branch 'master' of https://github.com/migounette/node_redis into migounette-master

This commit is contained in:
Bryce Baril
2014-07-10 22:01:34 -07:00
3 changed files with 64 additions and 6 deletions

View File

@@ -1214,16 +1214,27 @@ RedisClient.prototype.eval = RedisClient.prototype.EVAL = function () {
exports.createClient = function (port_arg, host_arg, options) {
var port = port_arg || default_port,
host = host_arg || default_host,
redis_client, net_client;
net_client = net.createConnection(port, host);
var cnxFamily;
if (options && options.family) {
cnxFamily = (options.family == 'IPv6' ? 6 : 4);
}
var cnxOptions = {
'port' : port_arg || default_port,
'host' : host_arg || default_host,
'family' : cnxFamily || '4'
};
var redis_client, net_client;
net_client = net.createConnection(cnxOptions);
redis_client = new RedisClient(net_client, options);
redis_client.port = port;
redis_client.host = host;
redis_client.port = cnxOptions.port;
redis_client.host = cnxOptions.host;
return redis_client;
};