Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Update to reflect changes in node v0.1.90.

  • Loading branch information...
commit b171aa530c310cf333eb66cad0b9c95a51e3b64f 1 parent 0789ec1
Tim Caswell authored April 08, 2010
6  lib/websocket.js
@@ -56,8 +56,8 @@ exports.createServer = function (on_connect) {
56 56
         }
57 57
       }
58 58
     };
59  
-    websocket.close = function () {
60  
-      socket.close();
  59
+    websocket.end = function () {
  60
+      socket.end();
61 61
     };
62 62
 
63 63
     socket.setEncoding("utf8");
@@ -67,7 +67,7 @@ exports.createServer = function (on_connect) {
67 67
 
68 68
       if(data.match(policyRequest)) {
69 69
         socket.write(policyXML);
70  
-        socket.close();
  70
+        socket.end();
71 71
         return;
72 72
       }
73 73
 
7  sample/server.js
@@ -42,7 +42,12 @@ websocket.createServer(function (socket) {
42 42
     // Remove this connection from the listeners array
43 43
     listeners.splice(listeners.indexOf(on_message), 1);
44 44
     // And close the connection
45  
-    socket.close();
  45
+    socket.end();
46 46
   });
  47
+  
  48
+  // // Close the socket after 10 seconds
  49
+  // setTimeout(function () {
  50
+  //   socket.end();
  51
+  // }, 10000)
47 52
 
48 53
 }).listen(8000, "0.0.0.0");

0 notes on commit b171aa5

Please sign in to comment.
Something went wrong with that request. Please try again.