api/lib/server-lib.js
function ensureConnected(remote, callback) {
  if (remote.getServer()) {
    callback(null, isConnected(remote));
  } else {
    callback(null, false);
  }
}
function ensureConnected(remote, callback) {
  if (remote.getServer()) {
    callback(null, isConnected(remote));
  } else {
    callback(null, false);
  }
}
function ensureConnected ( remote , callback ) { if ( remote . getServer ( ) ) { callback ( null , isConnected ( remote ) ) ; } else { callback ( null , false ) ; } }
Check if remote is connected and attempt to reconnect if not

@param {Remote} remote
@param {Function} callback
Check if remote is connected and attempt to reconnect if not