mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-11 06:47:14 +02:00
ZmqSocket prototype
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
|
||||
set(EXAMPLE_LIST "json_example;logger_example;numpy_read_example;multiport_example;raw_example")
|
||||
set(EXAMPLE_LIST "json_example;logger_example;numpy_read_example;multiport_example;raw_example;zmq_example;")
|
||||
set(EXAMPLE_LIST "${EXAMPLE_LIST};mythen_example;numpy_write_example")
|
||||
foreach(example ${EXAMPLE_LIST})
|
||||
add_executable(${example} ${example}.cpp)
|
||||
|
19
examples/zmq_example.cpp
Normal file
19
examples/zmq_example.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
#include <string>
|
||||
#include <fmt/core.h>
|
||||
#include "aare/ZmqSocket.hpp"
|
||||
|
||||
|
||||
|
||||
int main(){
|
||||
std::string endpoint = "tcp://localhost:5555";
|
||||
aare::ZmqSocket socket(endpoint);
|
||||
socket.connect();
|
||||
char* data = new char[1024*1024*10];
|
||||
aare::zmqHeader header;
|
||||
while(true){
|
||||
int rc = socket.receive(header, reinterpret_cast<std::byte*>(data));
|
||||
|
||||
}
|
||||
delete[] data;
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user