mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-14 15:25:35 +02:00
IPC pub sub test
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user