Spaces:
Sleeping
Sleeping
Update main.cpp
Browse files
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")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
}
|