api/lib/server-lib.js
function isConnected(remote) {
  if (isNaN(remote._ledger_current_index)) {
    // Remote is missing the index of last ledger closed. Unprepared to submit
    // transactions
    return false;
  }

  var server = remote.getServer();
  if (!server) {
    return false;
  }

  if (remote._stand_alone) {
    // If rippled is in standalone mode we can assume there will not be a
    // ledger close within 30 seconds.
    return true;
  }

  return (Date.now() - server._lastLedgerClose) <= CONNECTION_TIMEOUT;
}
function isConnected(remote) {
  if (isNaN(remote._ledger_current_index)) {
    // Remote is missing the index of last ledger closed. Unprepared to submit
    // transactions
    return false;
  }

  var server = remote.getServer();
  if (!server) {
    return false;
  }

  if (remote._stand_alone) {
    // If rippled is in standalone mode we can assume there will not be a
    // ledger close within 30 seconds.
    return true;
  }

  return (Date.now() - server._lastLedgerClose) <= CONNECTION_TIMEOUT;
}
function isConnected ( remote ) { if ( isNaN ( remote . _ledger_current_index ) ) { // Remote is missing the index of last ledger closed. Unprepared to submit // transactions return false ; } var server = remote . getServer ( ) ; if ( ! server ) { return false ; } if ( remote . _stand_alone ) { // If rippled is in standalone mode we can assume there will not be a // ledger close within 30 seconds. return true ; } return ( Date . now ( ) - server . _lastLedgerClose ) <= CONNECTION_TIMEOUT ; }
Determine if remote is connected based on time of last ledger closed

@param {Server} server
@return {Boolean}
Determine if remote is connected based on time of last ledger closed