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

Function server

robot/stream/driver.cpp:76–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76int server(actor_system& sys, uint16_t port) {
77 auto src = sys.spawn(producer);
78 auto actual_port = sys.middleman().publish(src, port);
79 if (!actual_port) {
80 std::cout << "failed to open port " << port << ": "
81 << to_string(actual_port.error()) << '\n';
82 return EXIT_FAILURE;
83 }
84 while (!shutdown_flag)
85 std::this_thread::sleep_for(250ms);
86 anon_send_exit(src, exit_reason::user_shutdown);
87 return EXIT_SUCCESS;
88}
89
90int client(actor_system& sys, const std::string& host, uint16_t port) {
91 auto attempt = 0;

Callers 1

caf_mainFunction · 0.70

Calls 6

anon_send_exitFunction · 0.85
to_stringFunction · 0.50
spawnMethod · 0.45
publishMethod · 0.45
middlemanMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected