NOT-OMEGA commited on
Commit
b36682c
Β·
verified Β·
1 Parent(s): d3c4835

Update main.cpp

Browse files
Files changed (1) hide show
  1. main.cpp +6 -2
main.cpp CHANGED
@@ -310,7 +310,11 @@ private:
310
  if (type == "operation") handle_operation(msg, doc);
311
  else if (type == "cursor") handle_cursor(msg);
312
  else if (type == "title_change") handle_title_change(msg);
313
- else if (type == "ping") { /* keep-alive, no-op */ }
 
 
 
 
314
  }
315
 
316
  // ── Operation handler (with broadcast batching) ───────────────────────────
@@ -504,4 +508,4 @@ int main(int argc, char* argv[]) {
504
 
505
  ioc.run();
506
  return 0;
507
- }
 
310
  if (type == "operation") handle_operation(msg, doc);
311
  else if (type == "cursor") handle_cursor(msg);
312
  else if (type == "title_change") handle_title_change(msg);
313
+ else if (type == "ping") {
314
+ json pong = msg;
315
+ pong["type"] = "pong";
316
+ enqueue_send(pong.dump());
317
+ }
318
  }
319
 
320
  // ── Operation handler (with broadcast batching) ───────────────────────────
 
508
 
509
  ioc.run();
510
  return 0;
511
+ }