| 353 | } |
| 354 | |
| 355 | void 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 | |
| 374 | void ConsoleServer::error(u32 client_id, const char *msg) |
| 375 | { |
no test coverage detected