docs: function Connector(src, onconnect) {
    events.EventEmitter.call(this);
  
    this.src = src;
  
    this.once('result', function (err, socket) {
      socket.removeAllListeners('error');
      if (err) {
        this.emit('prefailed', err);
        this.emit('failed', err);
      } else {
        this.emit('preready', socket);
        this.emit('ready', socket);
      }
    }).on('ready', function (socket) {
      onconnect(socket);
    }).on('failed', function (err) {
      src.emit('error', err);
    });
  }