bool OplogReader::connect(const BSONObj& rid, const int from, const string& to) { if (conn() != 0) { return true; } if (commonConnect(to, default_so_timeout)) { log() << "handshake between " << from << " and " << to << endl; return passthroughHandshake(rid, from); } return false; }
bool OplogReader::connect(const mongo::OID& rid, const int from, const string& to) { if (conn() != 0) { return true; } if (commonConnect(to)) { log() << "handshake between " << from << " and " << to << endl; return passthroughHandshake(rid, from); } return false; }
bool OplogReader::connect(const std::string& hostName) { if (conn()) { return true; } if (!commonConnect(hostName)) { return false; } return true; }
bool OplogReader::connect(const std::string& hostName, const BSONObj& me) { if (conn()) { return true; } if (!commonConnect(hostName)) { return false; } if (!replHandshake(_conn.get(), me)) { return false; } return true; }
bool OplogReader::connect(const std::string& hostName, const double default_timeout) { if (conn() != 0) { return true; } if ( ! commonConnect(hostName, default_timeout) ) { return false; } if ( _doHandshake && ! replHandshake(_conn.get() ) ) { return false; } return true; }