MCPcopy Create free account
hub / github.com/SoarGroup/Soar / SendClientMessage

Method SendClientMessage

Core/ClientSML/src/sml_ClientKernel.cpp:2247–2260  ·  view source on GitHub ↗

* @brief Send a message to another client (not the Soar kernel). * The other client must have registered for this message to receive it. * * This mechanism allows one client to send an arbitrary string to another client and * get a response (as a string). The contents of the string are up to the clients to agree upon. * Passing a string is sufficient to support either

Source from the content-addressed store, hash-verified

2245* @returns The response (if any) from the receiving client. The string "**NONE**" is reserved to indicate nobody was registered for this event.
2246*************************************************************/
2247std::string Kernel::SendClientMessage(Agent* pAgent, char const* pClientName, char const* pMessage)
2248{
2249 AnalyzeXML response ;
2250
2251 bool ok = GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_SendClientMessage, pAgent ? pAgent->GetAgentName() : NULL, sml_Names::kParamName, pClientName, sml_Names::kParamMessage, pMessage) ;
2252
2253 if (ok)
2254 {
2255 const char* pResponse = response.GetResultString() ;
2256 return pResponse ? pResponse : "" ;
2257 }
2258
2259 return GetLastErrorDescription() ;
2260}
2261
2262/*************************************************************
2263* @brief Unregister for a particular event

Callers 1

TestPythonSML.pyFile · 0.45

Calls 5

SendAgentCommandMethod · 0.80
GetAgentNameMethod · 0.80
GetConnectionFunction · 0.70
GetLastErrorDescriptionFunction · 0.50
GetResultStringMethod · 0.45

Tested by

no test coverage detected