Skip to content

Commit

Permalink
Update to reflect changes in node v0.1.90.
Browse files Browse the repository at this point in the history
  • Loading branch information
creationix committed Apr 8, 2010
1 parent 0789ec1 commit b171aa5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/websocket.js
Expand Up @@ -56,8 +56,8 @@ exports.createServer = function (on_connect) {
}
}
};
websocket.close = function () {
socket.close();
websocket.end = function () {
socket.end();
};

socket.setEncoding("utf8");
Expand All @@ -67,7 +67,7 @@ exports.createServer = function (on_connect) {

if(data.match(policyRequest)) {
socket.write(policyXML);
socket.close();
socket.end();
return;
}

Expand Down
7 changes: 6 additions & 1 deletion sample/server.js
Expand Up @@ -42,7 +42,12 @@ websocket.createServer(function (socket) {
// Remove this connection from the listeners array
listeners.splice(listeners.indexOf(on_message), 1);
// And close the connection
socket.close();
socket.end();
});

// // Close the socket after 10 seconds
// setTimeout(function () {
// socket.end();
// }, 10000)

}).listen(8000, "0.0.0.0");

0 comments on commit b171aa5

Please sign in to comment.