IPC pub sub test

This commit is contained in:
2020-04-22 13:11:20 +02:00
parent ae445106a3
commit 981ef8c2c3
2 changed files with 20 additions and 1 deletions
+11
View File
@@ -47,6 +47,7 @@ int main (int argc, char *argv[]) {
auto ctx = zmq_ctx_new();
auto socket = zmq_socket(ctx, ZMQ_PUSH);
auto meta_socket = zmq_socket(ctx, ZMQ_SUB);
int status = 0;
@@ -66,6 +67,16 @@ int main (int argc, char *argv[]) {
throw runtime_error(strerror (errno));
}
//TODO: Use ipc?
if (zmq_connect(socket, "ipc://writer_metad") != 0) {
throw runtime_error(strerror (errno));
}
cout << "receiving " << endl;
uint64_t response;
zmq_recv(meta_socket, &response, sizeof(response), 0);
cout << "Done!! " << response << endl;
for (const auto& suffix:path_suffixes) {
metadata_buffer->start_pulse_id = suffix.start_pulse_id;
metadata_buffer->stop_pulse_id = suffix.stop_pulse_id;