| 88 | } |
| 89 | |
| 90 | int client(actor_system& sys, const std::string& host, uint16_t port) { |
| 91 | auto attempt = 0; |
| 92 | auto src = sys.middleman().remote_actor(host, port); |
| 93 | if (!src) { |
| 94 | if (++attempt == 8) { |
| 95 | std::cout << "could not connect to server\n"; |
| 96 | return EXIT_FAILURE; |
| 97 | } |
| 98 | std::this_thread::sleep_for(125ms); |
| 99 | src = sys.middleman().remote_actor(host, port); |
| 100 | } |
| 101 | sys.spawn(consumer, *src); |
| 102 | return EXIT_SUCCESS; |
| 103 | } |
| 104 | |
| 105 | int caf_main(actor_system& sys, const config& cfg) { |
| 106 | signal(SIGTERM, set_shutdown_flag); |
no test coverage detected