* Sends a message to the connected peer and returns the bytes sent. * * @param message The message. * * @return The amount of bytes sent. */
| 54 | * @return The amount of bytes sent. |
| 55 | */ |
| 56 | size_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. |
no test coverage detected