Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Making listen callback similar to other listen callbacks in node.js

  • Loading branch information...
commit 57d01b60cd32b287d136dc4270c1e826a271de1c 1 parent 1f24314
@mikeal authored
Showing with 4 additions and 6 deletions.
  1. +4 −6 index.js
View
10 index.js
@@ -138,6 +138,10 @@ dnode.prototype.listen = function () {
var params = protocol.parseArgs(arguments);
var server = params.server;
+ if (params.block) {
+ this.on('ready', params.block);
+ }
+
if (params.port) {
if (params.key) {
var options = {
@@ -210,12 +214,6 @@ dnode.prototype.listen = function () {
middleware.call(client.instance, client.remote, client);
});
- if (params.block) {
- client.on('remote', function () {
- params.block.call(client.instance, client.remote, client);
- });
- }
-
client.start();
});
Please sign in to comment.
Something went wrong with that request. Please try again.