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

Add socket_nodelay option to control Nagle. Fixes [GH-33]

This commit is contained in:
Matt Ranney
2011-11-16 11:12:26 -10:00
parent bf806a0be3
commit b9734d13eb
3 changed files with 67 additions and 6 deletions

View File

@@ -33,6 +33,9 @@ function RedisClient(stream, options) {
this.connected = false;
this.ready = false;
this.connections = 0;
if (this.options.socket_nodelay === undefined) {
this.options.socket_nodelay = true;
}
this.should_buffer = false;
this.command_queue_high_water = this.options.command_queue_high_water || 1000;
this.command_queue_low_water = this.options.command_queue_low_water || 0;
@@ -200,7 +203,9 @@ RedisClient.prototype.on_connect = function () {
this.command_queue = new Queue();
this.emitted_end = false;
this.initialize_retry_vars();
this.stream.setNoDelay();
if (this.options.socket_nodelay) {
this.stream.setNoDelay();
}
this.stream.setTimeout(0);
this.init_parser();