src/mpd.js
/**
   * Initiate MPD connection with greeting message.
   * @param {string} message 
   */
Initiate MPD connection with greeting message.
@param {string} message
Initiate MPD connection with greeting message . @param { string } message
_initialGreeting(message) {
    this.server = parseGreeting(message);
    if (this.server === false) {
      this.restoreConnection();
      throw new Error(`Unexpected greeting message: '${message}'!`);
    }
    if (this.type === 'network' && this.keepAlive) {
      this.client.setKeepAlive(this.keepAlive);
    }
    this.client.on('data', d => this._onData(d));
    this.updateStatus()
      .then(() => this._updateSongs())
      .then(() => this._updatePlaylist())
      .then(() => this._setReady())
      .catch(e => this.emit('error', e));
  }
_initialGreeting ( message ) { this . server = parseGreeting ( message ) ; if ( this . server === false ) { this . restoreConnection ( ) ; throw new Error ( ` ${ message } ` ) ; } if ( this . type === 'network' && this . keepAlive ) { this . client . setKeepAlive ( this . keepAlive ) ; } this . client . on ( 'data' , d => this . _onData ( d ) ) ; this . updateStatus ( ) . then ( ( ) => this . _updateSongs ( ) ) . then ( ( ) => this . _updatePlaylist ( ) ) . then ( ( ) => this . _setReady ( ) ) . catch ( e => this . emit ( 'error' , e ) ) ; }
Initiate MPD connection with greeting message.
Initiate MPD connection with greeting message .