MCPcopy Create free account
hub / github.com/breach/thrust / SendReply

Method SendReply

src/api/api_server.cc:239–258  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237
238
239void
240APIServer::Client::SendReply(
241 const unsigned int id,
242 const std::string& error,
243 scoped_ptr<base::DictionaryValue> result)
244{
245 /* Runs on IO Thread. */
246 base::DictionaryValue action;
247 action.SetString("_action", "reply");
248 action.SetInteger("_id", id);
249 action.SetString("_error", error);
250 action.Set("_result", result->DeepCopy());
251
252 std::string payload;
253 base::JSONWriter::Write(&action, &payload);
254 payload += "\n" + std::string(kSocketBoundary) + "\n";
255
256 std::cout << payload;
257 std::cout.flush();
258}
259
260void
261APIServer::Client::SendEvent(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected