MCPcopy Create free account
hub / github.com/actor-framework/actor-framework / client

Function client

robot/stream/driver.cpp:90–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90int 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
105int caf_main(actor_system& sys, const config& cfg) {
106 signal(SIGTERM, set_shutdown_flag);

Callers 1

caf_mainFunction · 0.70

Calls 3

remote_actorMethod · 0.80
middlemanMethod · 0.45
spawnMethod · 0.45

Tested by

no test coverage detected