MCPcopy Create free account
hub / github.com/crownengine/crown / send

Method send

src/device/console_server.cpp:355–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355void ConsoleServer::send(u32 client_id, const char *json)
356{
357 TCPSocket socket;
358 if (!console_server_internal::get_socket_by_id(&socket, *this, client_id))
359 return;
360
361 const u32 msg_len = strlen32(json);
362
363 _output_mutex.lock();
364 FileBuffer fb(*_output_write);
365 fb.seek_to_end();
366 BinaryWriter bw(fb);
367 bw.write(client_id);
368 bw.write(msg_len);
369 bw.write(json, msg_len);
370 _output_condition.signal();
371 _output_mutex.unlock();
372}
373
374void ConsoleServer::error(u32 client_id, const char *msg)
375{

Callers 4

console_command_compileFunction · 0.80
device_message_refreshFunction · 0.80
console_command_suggestFunction · 0.80

Calls 6

get_socket_by_idFunction · 0.85
signalMethod · 0.80
lockMethod · 0.45
seek_to_endMethod · 0.45
writeMethod · 0.45
unlockMethod · 0.45

Tested by

no test coverage detected