Ejemplo n.º 1
0
 void SyncClusterConnection::_connect( const std::string& host ) {
     log() << "SyncClusterConnection connecting to [" << host << "]" << endl;
     DBClientConnection * c = new DBClientConnection( true );
     c->setRunCommandHook(_runCommandHook);
     c->setPostRunCommandHook(_postRunCommandHook);
     c->setSoTimeout( _socketTimeout );
     string errmsg;
     if ( ! c->connect( HostAndPort(host), errmsg ) )
         log() << "SyncClusterConnection connect fail to: " << host << " errmsg: " << errmsg << endl;
     _connAddresses.push_back( host );
     _conns.push_back( c );
 }