Skip to content
This repository has been archived by the owner on Mar 27, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
… into sazze-master
  • Loading branch information
miksago committed Mar 25, 2011
2 parents d07e0f1 + 72ad210 commit d2ab6fb
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ws/connection.js
Expand Up @@ -96,6 +96,11 @@ function Connection(manager, options, req, socket, upgradeHead) {
debug(connection.id, 'recv: ' + message);
connection.emit('message', message);
});

parser.on("close", function() {
debug(connection.id, "requested close");
connection.close();
});

socket.on('data', function(data) {
parser.write(data);
Expand Down Expand Up @@ -419,6 +424,10 @@ Parser.prototype.write = function(data) {
} else if (this.order == 1) {
debug('High Order packet handling is not yet implemented.');
this.order = 0;

if(data[i] === 0x00){
this.emit("close");
}
}
}
};
Expand Down

0 comments on commit d2ab6fb

Please sign in to comment.