Permalink
Browse files

changed auth example to leak callbacks

  • Loading branch information...
1 parent f66cc7f commit d7a31724074df69e5aff6cf951a3b9b0261f016b @thejh committed Oct 8, 2011
Showing with 8 additions and 5 deletions.
  1. +8 −5 examples/auth/client.js
View
@@ -16,11 +16,14 @@ DNode.connect(7007, function (remote,conn) {
remote.authenticate(user, pass, function (session) {
if (session) {
sys.puts('Authentication success');
- session.quote(function (q) {
- sys.puts('\nAnd now for a quote by ' + q.who + ':\n\n');
- sys.puts(q.quote + '\n\n');
- conn.end();
- });
+ function showNext() {
+ session.quote(function (q) {
+ sys.puts('\nAnd now for a quote by ' + q.who + ':\n\n');
+ sys.puts(q.quote + '\n\n');
+ });
+ setTimeout(showNext, 5000);
+ }
+ showNext();
}
else {
sys.puts('Authentication failure');

0 comments on commit d7a3172

Please sign in to comment.