Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int subscribe_to_pipe(const char* sub_name, const char* client_name) {
- std::lock_guard<std::mutex> lock(mtx);
- if (pipe_expand_location_string(sub_name, pipe_name) < 0) {
- std::cerr << "ERROR: Invalid pipe name: " << sub_name << std::endl;
- return -1;
- }
- sub_channel = pipe_client_get_next_available_channel();
- pipe_client_set_simple_helper_cb(sub_channel, detection_callback, nullptr);
- if (pipe_client_open(sub_channel, pipe_name, client_name, EN_PIPE_CLIENT_SIMPLE_HELPER, sizeof(ai_detection_t) * 32) < 0) {
- std::cerr << "ERROR: Failed to subscribe to pipe" << std::endl;
- return -1;
- }
- return sub_channel;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement