Permalink
Browse files

Update to reflect changes in node v0.1.90.

  • Loading branch information...
creationix committed Apr 8, 2010
1 parent 0789ec1 commit b171aa530c310cf333eb66cad0b9c95a51e3b64f
Showing with 9 additions and 4 deletions.
  1. +3 −3 lib/websocket.js
  2. +6 −1 sample/server.js
View
@@ -56,8 +56,8 @@ exports.createServer = function (on_connect) {
}
}
};
- websocket.close = function () {
- socket.close();
+ websocket.end = function () {
+ socket.end();
};
socket.setEncoding("utf8");
@@ -67,7 +67,7 @@ exports.createServer = function (on_connect) {
if(data.match(policyRequest)) {
socket.write(policyXML);
- socket.close();
+ socket.end();
return;
}
View
@@ -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.