Skip to content

Commit

Permalink
Call setNoDelay(true) on sockets.
Browse files Browse the repository at this point in the history
  • Loading branch information
jcoglan committed Jan 16, 2012
1 parent e2090ce commit ce0f81c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/faye/eventsource.js
Expand Up @@ -19,6 +19,9 @@ var EventSource = function(request, response, options) {
this._ping = options.ping || this.DEFAULT_PING;
this._retry = options.retry || this.DEFAULT_RETRY;

this._stream.setTimeout(0);
this._stream.setNoDelay(true);

var scheme = isSecureConnection(request) ? 'https:' : 'http:';
this.url = scheme + '//' + request.headers.host + request.url;

Expand Down
3 changes: 3 additions & 0 deletions lib/faye/websocket.js
Expand Up @@ -35,6 +35,9 @@ var WebSocket = function(request, socket, head, supportedProtos) {
this.request = request;
this._stream = request.socket;

this._stream.setTimeout(0);
this._stream.setNoDelay(true);

var scheme = isSecureConnection(request) ? 'wss:' : 'ws:';
this.url = scheme + '//' + request.headers.host + request.url;
this.readyState = API.CONNECTING;
Expand Down
3 changes: 3 additions & 0 deletions lib/faye/websocket/client.js
Expand Up @@ -24,6 +24,9 @@ var Client = function(url, protocols) {
this._parser = new HybiParser(this, {masking: true, protocols: protocols});
this._stream = connection;

this._stream.setTimeout(0);
this._stream.setNoDelay(true);

if (!secure) connection.addListener('connect', onConnect);

connection.addListener('data', function(data) {
Expand Down

0 comments on commit ce0f81c

Please sign in to comment.