Skip to content

Commit

Permalink
Let noDelay (disable Nagle) be set in connect options
Browse files Browse the repository at this point in the history
It's not clear that it's a performance boost, so I've left it to
default to `false`, that is not disabled.
  • Loading branch information
squaremo committed Jan 20, 2014
1 parent 68292cd commit 854b175
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function connect(url, socketOptions) {

var parts = URL.parse(url, true); // yes, parse the query string
var protocol = parts.protocol;
var net;
var noDelay = !!sockopts.noDelay;

var options = openOptionsFromURL(parts);
var port = parts.port || ((protocol === 'amqp:') ? 5672 : 5671);
Expand All @@ -103,6 +103,7 @@ function connect(url, socketOptions) {

function onConnect() {
sockok = true;
sock.setNoDelay(noDelay);
var c = new Connection(sock);
c.open(options).then(function (_openok) { result.resolve(c); },
function(err) { result.reject(err); });
Expand Down

0 comments on commit 854b175

Please sign in to comment.