/* Function : onSolicitVersion * Arguments : daemonSinfulString - the address of remote replication daemon, * which sent the REPLICATION_SOLICIT_VERSION command * Description: handler of REPLICATION_SOLICIT_VERSION command; sending local * version along with current replication daemon state */ void ReplicatorStateMachine::onSolicitVersion( char* daemonSinfulString ) { dprintf( D_ALWAYS, "ReplicatorStateMachine::onSolicitVersion %s started\n", daemonSinfulString ); if( m_state == BACKUP || m_state == REPLICATION_LEADER ) { sendVersionAndStateCommand( REPLICATION_SOLICIT_VERSION_REPLY, daemonSinfulString ); } }
// sending command, along with the local replication daemon's version and state void AbstractReplicatorStateMachine::broadcastVersion( int command ) { char* replicationDaemon = NULL; m_replicationDaemonsList.rewind( ); while( (replicationDaemon = m_replicationDaemonsList.next( )) ) { sendVersionAndStateCommand( command, replicationDaemon ); } m_replicationDaemonsList.rewind( ); }