Permalink
Browse files

websocket.Connection: setTimeout to infinity

  • Loading branch information...
1 parent 3e74b16 commit 1f84131d4f75e20c5f3804732f2b4325493e891d @zimbatm committed Dec 26, 2009
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/http/websocket.js
View
@@ -36,6 +36,7 @@ function Connection(request, response) {
request.addListener("complete", function() {
// Hijack connection after handshake
conn.hijack();
+ conn.setTimeout(0);
conn.addListener("receive", function(data) {
if (data[0] !== '\u0000' && data[data.length - 1] !== '\ufffd') {
// Invalid data
@@ -74,6 +75,8 @@ Connection.prototype.remoteAddress = null;
/*
websocket.Server
+
+a connection manager
*/
function Server() {
process.EventEmitter.call(this);
@@ -118,9 +121,7 @@ exports.Server = Server;
function maybeRemove(arr, elem) {
for (var i=0; i<arr.length; i++) {
if (arr[i] == elem) {
- sys.p(arr);
arr.splice(i, 1);
- sys.p(arr);
return true;
}
}

0 comments on commit 1f84131

Please sign in to comment.