vantage icon indicating copy to clipboard operation
vantage copied to clipboard

Listen callback does not fire until first connection

Open giodamelio opened this issue 9 years ago • 1 comments

When using vantage in standalone mode, the listen callback does not fire until I connect to it with the command line client.

var Vantage = require('vantage');
var vantageServer = new Vantage();

vantageServer
  .delimiter('$')
  .listen(2001, function() {
    console.log('Started vantage server at http://localhost:2001');
  });

giodamelio avatar Mar 10 '16 07:03 giodamelio

This is by design, see https://github.com/dthree/vantage/blob/7e5a8019591f14bd0836875589c4795730c9e88c/lib/server.js#L195 - the callback is called on the socket connection event, not when the vantage server is initialised.

zakhenry avatar Jun 05 '16 19:06 zakhenry