本文整理汇总了C++中co::ICommand::getLocalNode方法的典型用法代码示例。如果您正苦于以下问题:C++ ICommand::getLocalNode方法的具体用法?C++ ICommand::getLocalNode怎么用?C++ ICommand::getLocalNode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类co::ICommand
的用法示例。
在下文中一共展示了ICommand::getLocalNode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _cmdChooseConfigReply
//---------------------------------------------------------------------------
// 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;
}
示例2: _cmdExit
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;
}
示例3: _cmdShutdownReply
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;
}
示例4: _cmdReleaseConfigReply
bool Server::_cmdReleaseConfigReply( co::ICommand& command )
{
co::LocalNodePtr localNode = command.getLocalNode();
localNode->serveRequest( command.get< uint32_t >( ));
return true;
}