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

Method SendEvent

src/api/api_server.cc:260–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

258}
259
260void
261APIServer::Client::SendEvent(
262 unsigned int target,
263 const std::string type,
264 scoped_ptr<base::DictionaryValue> event)
265{
266 /* Runs on IO Thread. */
267 base::DictionaryValue action;
268 action.SetString("_action", "event");
269 action.SetInteger("_id", ++action_id_);
270 action.SetInteger("_target", target);
271 action.SetString("_type", type);
272 action.Set("_event", event->DeepCopy());
273
274 std::string payload;
275 base::JSONWriter::Write(&action, &payload);
276 payload += "\n" + std::string(kSocketBoundary) + "\n";
277
278 std::cout << payload;
279 std::cout.flush();
280}
281
282void
283APIServer::Client::SendInvoke(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected