MCPcopy Create free account
hub / github.com/Icinga/icinga2 / SendMessage

Method SendMessage

lib/remote/jsonrpc.cpp:56–66  ·  view source on GitHub ↗

* Sends a message to the connected peer and returns the bytes sent. * * @param message The message. * * @return The amount of bytes sent. */

Source from the content-addressed store, hash-verified

54 * @return The amount of bytes sent.
55 */
56size_t JsonRpc::SendMessage(const Shared<AsioTlsStream>::Ptr& stream, const Dictionary::Ptr& message)
57{
58 String json = JsonEncode(message);
59
60#ifdef I2_DEBUG
61 if (GetDebugJsonRpcCached())
62 std::cerr << ConsoleColorTag(Console_ForegroundBlue) << ">> " << json << ConsoleColorTag(Console_Normal) << "\n";
63#endif /* I2_DEBUG */
64
65 return NetString::WriteStringToStream(stream, json);
66}
67
68/**
69 * Sends a message to the connected peer and returns the bytes sent.

Callers 8

SendConfigUpdateMethod · 0.45
ApiTimerHandlerMethod · 0.45
SyncSendMessageMethod · 0.45
ReplayLogMethod · 0.45
UpdateConfigObjectMethod · 0.45
DeleteConfigObjectMethod · 0.45

Calls 2

GetDebugJsonRpcCachedFunction · 0.85
ConsoleColorTagClass · 0.85

Tested by

no test coverage detected