| 159 | } |
| 160 | |
| 161 | void DaemonClient::submitPayload(const Value& payload) const { |
| 162 | auto data = valueToJson(payload); |
| 163 | |
| 164 | auto dataSender = getDataSender(); |
| 165 | if (dataSender == nullptr) { |
| 166 | return; |
| 167 | } |
| 168 | |
| 169 | auto bytes = makeShared<ByteBuffer>(); |
| 170 | if (dataSender->requiresPacketEncoding()) { |
| 171 | ValdiPacket::write(data->data(), data->size(), *bytes); |
| 172 | } else { |
| 173 | bytes = data; |
| 174 | } |
| 175 | dataSender->submitData(bytes->toBytesView()); |
| 176 | } |
| 177 | |
| 178 | void DaemonClient::submitRequest(Value request, Function<void(const Value&)> completionHandler) { |
| 179 | auto pendingResponse = Valdi::makeShared<DaemonClientPendingResponse>(completionHandler); |
nothing calls this directly
no test coverage detected