lib/haibu/core/spawner.js
function onCarapacePort (info) {
      if (!responded && info && info.event === 'port') {
        responded = true;
        result.socket = {
          host: self.host,
          port: info.data.port
        };
        
        drone.minUptime = 0;

        haibu.emit('drone:port', 'info', {
          pkg: app,
          info: info
        });
        
        callback(null, result);
        
        //
        // Remove listeners to related events
        //
        drone.removeListener('exit', onExit);
        drone.removeListener('error', onError);
        clearTimeout(timeout);
      }
    }
function onCarapacePort (info) {
      if (!responded && info && info.event === 'port') {
        responded = true;
        result.socket = {
          host: self.host,
          port: info.data.port
        };
        
        drone.minUptime = 0;

        haibu.emit('drone:port', 'info', {
          pkg: app,
          info: info
        });
        
        callback(null, result);
        
        //
        // Remove listeners to related events
        //
        drone.removeListener('exit', onExit);
        drone.removeListener('error', onError);
        clearTimeout(timeout);
      }
    }
function onCarapacePort ( info ) { if ( ! responded && info && info . event === 'port' ) { responded = true ; result . socket = { host : self . host , port : info . data . port } ; drone . minUptime = 0 ; haibu . emit ( 'drone:port' , 'info' , { pkg : app , info : info } ) ; callback ( null , result ) ; // // Remove listeners to related events // drone . removeListener ( 'exit' , onExit ) ; drone . removeListener ( 'error' , onError ) ; clearTimeout ( timeout ) ; } }
When the carapace provides the port that the drone has bound to then respond to the callback
When the carapace provides the port that the drone has bound to then respond to the callback