//--------------------------------------------------------------------------- // command handlers //--------------------------------------------------------------------------- bool Server::_cmdChooseConfigReply( co::ICommand& command ) { co::LocalNodePtr localNode = command.getLocalNode(); const UUID configID = command.get< UUID >(); const uint32_t requestID = command.get< uint32_t >(); LBVERB << "Handle choose config reply " << command << " req " << requestID << " id " << configID << std::endl; if( configID == UUID::ZERO ) { localNode->serveRequest( requestID, (void*)0 ); return true; } const std::string connectionData = command.get< std::string >(); const Configs& configs = getConfigs(); for( Configs::const_iterator i = configs.begin(); i != configs.end(); ++i ) { Config* config = *i; if( config->getID() == configID ) { config->setupServerConnections( connectionData ); localNode->serveRequest( requestID, config ); return true; } } LBUNIMPLEMENTED return true; }
bool Client::_cmdExit( co::ICommand& command ) { _impl->running = false; // Close connection here, this is the last command we'll get on it command.getLocalNode()->disconnect( command.getRemoteNode( )); return true; }
bool Server::_cmdShutdownReply( co::ICommand& command ) { co::LocalNodePtr localNode = command.getLocalNode(); const uint32_t requestID = command.get< uint32_t >(); const bool result = command.get< bool >(); localNode->serveRequest( requestID, result ); return true; }
bool Server::_cmdReleaseConfigReply( co::ICommand& command ) { co::LocalNodePtr localNode = command.getLocalNode(); localNode->serveRequest( command.get< uint32_t >( )); return true; }