Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

changed auth example to leak callbacks

  • Loading branch information...
commit d7a31724074df69e5aff6cf951a3b9b0261f016b 1 parent f66cc7f
Jann Horn authored October 08, 2011

Showing 1 changed file with 8 additions and 5 deletions. Show diff stats Hide diff stats

  1. 13  examples/auth/client.js
13  examples/auth/client.js
@@ -16,11 +16,14 @@ DNode.connect(7007, function (remote,conn) {
16 16
     remote.authenticate(user, pass, function (session) {
17 17
         if (session) {
18 18
             sys.puts('Authentication success');
19  
-            session.quote(function (q) {
20  
-                sys.puts('\nAnd now for a quote by ' + q.who + ':\n\n');
21  
-                sys.puts(q.quote + '\n\n');
22  
-                conn.end();
23  
-            });
  19
+            function showNext() {
  20
+                session.quote(function (q) {
  21
+                    sys.puts('\nAnd now for a quote by ' + q.who + ':\n\n');
  22
+                    sys.puts(q.quote + '\n\n');
  23
+                });
  24
+                setTimeout(showNext, 5000);
  25
+            }
  26
+            showNext();
24 27
         }
25 28
         else {
26 29
             sys.puts('Authentication failure');

0 notes on commit d7a3172

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